-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Cannot import umd/commonjs bundle in stories #5778
Comments
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
anything new here? i ran into the same problem |
I think this problem may be gone after I upgrade to storybook v5. |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
So I managed to solve this issue by configuring It was odd that I only encountered this in Storybook. In my normal setup, Webpack automatically hooks into the AMD |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook! |
Describe the bug
Tried to import an umd bundle in stories file and got warning in webpack (v4) that cannot find exports from the bundle.
Further investigation leads to "no exports provided" for the umd bundle when webpack tries to bundle the stories. Compare to other cases where I import from source code, I found webpack is using harmony-module.js instead of module.js to process the module, which causing the umd bundle put exported stuff on global (window) instead of the exports object passed in.
The umd bundle is not a harmony (es6) module. It seems in this case webpack mistakenly think this is a harmony module. Since this is not happening in a different codebase, and I think storybook seems mixing its own webpack dependencies to the one on the host directory, I feel there maybe something wrong in how storybook use webpack.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Code compiles and I can get the things I imported from the bundle
System:
The text was updated successfully, but these errors were encountered: