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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: Fix breaking change in process/browser #16795

Merged
merged 1 commit into from Nov 26, 2021

Conversation

SebastienGllmt
Copy link
Contributor

@SebastienGllmt SebastienGllmt commented Nov 26, 2021

Issue:

What I did

Trying to build the latest SB 6.4 gives me the following error

ModuleNotFoundError: Module not found: Error: Can't resolve 'process/browser' in '/home/sebdev20/Documents/git/Flint2/node_modules/uvu/node_modules/kleur'

Did you mean 'browser.js'?

BREAKING CHANGE: The request 'process/browser' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').

The extension in the request is mandatory for it to be fully specified.

Changing the line to browser.js fixes the issue.

I'm not sure which breaking change causes this exactly of if there is a better fix for this issue, but it seems to have affected other people as well in different projects

I did notice that the package.json for process/browser has the following alias in it

"browser": "./browser.js",

So it seems that this is meant to be aliased in the package.json and specifying process/browser.js is just by-passing the package.json alias and going straight to the file 馃

@nx-cloud
Copy link

nx-cloud bot commented Nov 26, 2021

Nx Cloud Report

CI ran the following commands for commit d443c73. Click to see the status, the terminal output, and the build insights.

馃搨 See all runs for this branch

Status Command
#000000 nx run-many --target=prepare --all --parallel --max-parallel=15

Sent with 馃拰 from NxCloud.

@SebastienGllmt SebastienGllmt changed the title Fix breaking changing process/browser Fix breaking change in process/browser Nov 26, 2021
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @SebastienGllmt !! Merging 馃檹

@shilman shilman changed the title Fix breaking change in process/browser Core: Fix breaking change in process/browser Nov 26, 2021
@shilman shilman added this to the 6.4 PRs milestone Nov 26, 2021
@shilman shilman merged commit 4f23295 into storybookjs:next Nov 26, 2021
@SebastienGllmt
Copy link
Contributor Author

For anybody curious, I found this issue that explains what happened: webpack/webpack#11467 (comment)

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

Successfully merging this pull request may close these issues.

None yet

2 participants