Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module 'default-browser-id' in v.6.5.2 #18268

Closed
muratcorlu opened this issue May 19, 2022 · 16 comments
Closed

Error: Cannot find module 'default-browser-id' in v.6.5.2 #18268

muratcorlu opened this issue May 19, 2022 · 16 comments

Comments

@muratcorlu
Copy link
Contributor

muratcorlu commented May 19, 2022

Describe the bug

I think #18157 breaks start-storybook command.

> start-storybook -p 1994

node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'default-browser-id'
Require stack:
- /Users/muratcorlu/works/trendyol/grace/node_modules/@aw-web-design/x-default-browser/lib/detect-mac.js
- /Users/muratcorlu/works/trendyol/grace/node_modules/@aw-web-design/x-default-browser/index.js
- /Users/muratcorlu/works/trendyol/grace/node_modules/@storybook/core-server/dist/cjs/utils/open-in-browser.js
- /Users/muratcorlu/works/trendyol/grace/node_modules/@storybook/core-server/dist/cjs/dev-server.js
- /Users/muratcorlu/works/trendyol/grace/node_modules/@storybook/core-server/dist/cjs/build-dev.js
- /Users/muratcorlu/works/trendyol/grace/node_modules/@storybook/core-server/dist/cjs/index.js
- /Users/muratcorlu/works/trendyol/grace/node_modules/@storybook/core/dist/cjs/server.js
- /Users/muratcorlu/works/trendyol/grace/node_modules/@storybook/core/server.js
- /Users/muratcorlu/works/trendyol/grace/node_modules/@storybook/web-components/dist/cjs/server/index.js
- /Users/muratcorlu/works/trendyol/grace/node_modules/@storybook/web-components/bin/index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/muratcorlu/works/trendyol/grace/node_modules/@aw-web-design/x-default-browser/lib/detect-mac.js:1:25)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/muratcorlu/works/trendyol/grace/node_modules/@aw-web-design/x-default-browser/lib/detect-mac.js',
    '/Users/muratcorlu/works/trendyol/grace/node_modules/@aw-web-design/x-default-browser/index.js',
    '/Users/muratcorlu/works/trendyol/grace/node_modules/@storybook/core-server/dist/cjs/utils/open-in-browser.js',
    '/Users/muratcorlu/works/trendyol/grace/node_modules/@storybook/core-server/dist/cjs/dev-server.js',
    '/Users/muratcorlu/works/trendyol/grace/node_modules/@storybook/core-server/dist/cjs/build-dev.js',
    '/Users/muratcorlu/works/trendyol/grace/node_modules/@storybook/core-server/dist/cjs/index.js',
    '/Users/muratcorlu/works/trendyol/grace/node_modules/@storybook/core/dist/cjs/server.js',
    '/Users/muratcorlu/works/trendyol/grace/node_modules/@storybook/core/server.js',
    '/Users/muratcorlu/works/trendyol/grace/node_modules/@storybook/web-components/dist/cjs/server/index.js',
    '/Users/muratcorlu/works/trendyol/grace/node_modules/@storybook/web-components/bin/index.js'
  ]
}

To Reproduce

Sorry npx sb@next repro fails on my local as well. But just running to start-storybook in v6.5.2 should reproduce this error, I assume.

System

Environment Info:

  System:
    OS: macOS 12.4
    CPU: (8) arm64 Apple M1
  Binaries:
    Node: 16.15.0 - /usr/local/bin/node
    Yarn: 1.22.10 - ~/.npm/bin/yarn
    npm: 8.5.5 - /usr/local/bin/npm
  Browsers:
    Firefox: 100.0.1
    Safari: 15.5
  npmPackages:
    @storybook/addon-a11y: ^6.5.2 => 6.5.2 
    @storybook/addon-actions: ^6.5.2 => 6.5.2 
    @storybook/addon-essentials: ^6.5.2 => 6.5.2 
    @storybook/addon-links: ^6.5.2 => 6.5.2 
    @storybook/addon-storysource: ^6.5.2 => 6.5.2 
    @storybook/web-components: ^6.5.2 => 6.5.2 
@inlet
Copy link

inlet commented May 19, 2022

Same error here

@mgburns
Copy link

mgburns commented May 19, 2022

Breaks build-storybook as well.

@blackazaru
Copy link

Same error.

@pomelo-chuan
Copy link

same error

@JonathanSchndr
Copy link

same error. i try to install the old version, but is not working npx storybook@6.4.22 init ?

@Chrisdo82
Copy link

same error

@muratcorlu
Copy link
Contributor Author

To see hundreds of "same error" messages here will not help anything and also makes our lives more difficult. Please don't!

@JonathanSchndr
Copy link

To see hundreds of "same error" messages here will not help anything and also makes our lives more difficult. Please don't!

ok and my question also does not matter?

@muratcorlu
Copy link
Contributor Author

I think a new release is already on the way #18270

@AirmiX
Copy link

AirmiX commented May 19, 2022

Reverting to 6.5.0 worked for me.
After that I ended up with Module not found: Error: Can't resolve '@mdx-js/react' error and deleting generated Introduction.stories.mdx file resolved it, since I don't have any other mdx stories for now.

Ofc, it's not the solution, just a temporary workound.

@muratcorlu
Copy link
Contributor Author

Reverting to 6.5.0 worked for me. After that I ended up with Module not found: Error: Can't resolve '@mdx-js/react' error and deleting generated Introduction.stories.mdx file resolved it, since I don't have any other mdx stories for now.

Ofc, it's not the solution, just a temporary workound.

I also reported that mdx issue #18266

@Chrisdo82
Copy link

Chrisdo82 commented May 19, 2022

Downgrading to 6.5.0 didn't work for me, I get this Error: NormalModuleFactory.beforeResolve (IgnorePlugin) is no longer a waterfall hook, but a bailing hook instead. Do not return the passed object, but modify it instead. Returning false will ignore the request and results in no module created. #18265

@vjastik
Copy link

vjastik commented May 19, 2022

6.5.0 version is working for me as well.

@yannbf
Copy link
Member

yannbf commented May 19, 2022

Thanks for reporting this issue @muratcorlu.
The issue has been fixed and should be good in 6.5.3. Please give that a try! Thank you!

@yannbf yannbf closed this as completed May 19, 2022
@cubabit
Copy link

cubabit commented Jul 6, 2022

I get this error when I install my dependencies from scratch with yarn install --ignore-optional. It fails because default-browser-id is listed as an optional dependency of x-default-browser which itself is a dependency of @storybook/core-server. It seems it is not actually optional (at least not for me on MacOS).

For my version of storybook (6.5.9) I added this to my package.json devDependencies and it fixed the issue.

"default-browser-id": "1.0.4",

@muratcorlu
Copy link
Contributor Author

default-browser-id is only used in macOS. So it's optional for Linux and Windows users but not for macOS users. So if you want to exclude optional packages, you need to install it manually since you are working on a mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests