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

Webpack: Fix for process fallback using require.resolve #17249

Merged
merged 2 commits into from Jan 16, 2022

Conversation

merceyz
Copy link
Contributor

@merceyz merceyz commented Jan 15, 2022

Issue: #16896

@storybook/builder-webpack5 uses the ProvidePlugin to provide a polyfill of the process module but doesn't resolve the absolute path to it nor declare it as a dependency.

There are more dependency issues but I'll leave those for another time.

What I did

Use require.resolve to get the absolute path to process/browser.js and declare process as a dependency.

How to test

  • Is this testable with Jest or Chromatic screenshots?
  • Does this need a new example in the kitchen sink apps?
  • Does this need an update to the documentation?

The PnP e2e test should catch this but it seems it has other issues at the moment.

@nx-cloud
Copy link

nx-cloud bot commented Jan 15, 2022

☁️ Nx Cloud Report

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

📂 See all runs for this branch


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@shilman shilman changed the title fix(webpack5): use require.resolve for process fallback Webpack: Fix for process fallback using require.resolve Jan 16, 2022
@shilman shilman added bug patch:yes Bugfix & documentation PR that need to be picked to main branch builder-webpack5 labels Jan 16, 2022
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 @merceyz !! 🙏 Added a fix for the manager-webpack5 dependency also

@shilman shilman merged commit 011617f into storybookjs:next Jan 16, 2022
@merceyz merceyz deleted the merceyz/fix/process-fallback branch January 16, 2022 15:58
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label Jan 20, 2022
shilman added a commit that referenced this pull request Jan 20, 2022
Webpack: Fix for `process` fallback using `require.resolve`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug builder-webpack5 patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants