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

[5.2.0-beta.x] babel-loader error: Cannot find module core-js/modules/web.immediate.js and others #7407

Closed
orangeloops opened this issue Jul 12, 2019 · 12 comments

Comments

@orangeloops
Copy link

After migration from 5.1.1 to 5.2.0-alpha.x (exactly the same config file) multiple babel-loader error arise.

Repo to reproduce (branch storybook_5_2_0):
https://github.com/orangeloops/public-ol-web-template/tree/storybook_5_2_0
npm install
npm run storybook

Modules:
es.symbol.iterator.js, es.symbol.js, es.symbol.to-string-tag.js, web.dom-collections.for-each.js

Error example:
ERROR in ./node_modules/@storybook/channels/dist/index.js
Module not found: Error: Cannot find module '/Users/daniel/Code/OrangeLoops/public-ol-web-template/node_modules/babel-loader/lib/index.js??ref--7-oneOf-6!/Users/daniel/Code/OrangeLoops/public-ol-web-template/node_modules/core-js/modules/web.immediate.js'
Require stack:

  • /Users/daniel/Code/OrangeLoops/public-ol-web-template/node_modules/corejs-upgrade-webpack-plugin/dist/index.js
  • /Users/daniel/Code/OrangeLoops/public-ol-web-template/node_modules/@storybook/core/dist/server/manager/manager-webpack.config.js
  • /Users/daniel/Code/OrangeLoops/public-ol-web-template/node_modules/@storybook/core/dist/server/manager/manager-preset.js
  • /Users/daniel/Code/OrangeLoops/public-ol-web-template/node_modules/@storybook/core/dist/server/presets.js
  • /Users/daniel/Code/OrangeLoops/public-ol-web-template/node_modules/@storybook/core/dist/server/config.js
  • /Users/daniel/Code/OrangeLoops/public-ol-web-template/node_modules/@storybook/core/dist/server/build-static.js
  • /Users/daniel/Code/OrangeLoops/public-ol-web-template/node_modules/@storybook/core/server.js
  • /Users/daniel/Code/OrangeLoops/public-ol-web-template/node_modules/@storybook/react/dist/server/index.js
  • /Users/daniel/Code/OrangeLoops/public-ol-web-template/node_modules/@storybook/react/bin/index.js
    @ ./node_modules/@storybook/channels/dist/index.js 35:0-40
    @ ./node_modules/@storybook/addons/dist/storybook-channel-mock.js
    @ ./node_modules/@storybook/addons/dist/public_api.js
    @ ./node_modules/@storybook/addon-knobs/dist/index.js
    @ ./.storybook/config.js
@Badlapje
Copy link

I have this exact same error when i clone the learn storybook repo and install this addon.

@orangeloops orangeloops changed the title [5.2.0-alpha.x] babel-loader error: Cannot find module core-js/modules/web.immediate.js and others [5.2.0-beta.x] babel-loader error: Cannot find module core-js/modules/web.immediate.js and others Jul 22, 2019
@orangeloops
Copy link
Author

@norbert @shilman hi, how are you ?

did you have any chance to review this issue ? I can't migrate from 5.1.1 to any new version because of this issue.

@Badlapje mention that this issue also can be reproduced using "Learn Storybook" repo.

Thanks,
Daniel.

@ndelangen
Copy link
Member

Thanks for the report:
orangeloops/public-ol-web-template#17

Seems like core-js packages REALLY don't want to be transpiled by babel for some reason.

Make sure core-js is ignored if you're passing node_modules though babel (which isn't recommended for performance reason really.

@orangeloops
Copy link
Author

@ndelangen

Babel error was fixed 👍 , thank you!

BUT now I have "Rendered more hooks than during the previous render." with exactly the same basic story from 5.1.1

I did the merge on https://github.com/orangeloops/public-ol-web-template/tree/storybook_5_2_0

@ndelangen
Copy link
Member

@Hypnosphi 2 months ago you added the error; and migrated addon-knobs to use the new hooks api.

What do you think might cause this behaviour?
orangeloops/public-ol-web-template#17 (comment)

Screenshot 2019-07-23 at 10 09 31

@Hypnosphi
Copy link
Member

Hypnosphi commented Jul 23, 2019

Will take a look

There's a chance that I broke conditional knobs

UPD: nope, they work: https://monorepo.storybook.now.sh/examples/official-storybook/?path=/story/addons-knobs-withknobs--dynamic-knobs

@ndelangen
Copy link
Member

Thanks for taking a look!

I looked at the @orangeloops code for how they create stories, but it a bit more complex then I could digest at a glance. I'm unsure if they use conditional knobs, but it could also be something async they do that causes this.

@Hypnosphi
Copy link
Member

@ndelangen looks like the reason is storybook-router that exports a decorator which passes storyFn to a component instead of calling it synchronously:

https://github.com/gvaldambrini/storybook-router/blob/master/packages/react/react.js#L91-L97

@stale
Copy link

stale bot commented Aug 17, 2019

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!

@stale stale bot added the inactive label Aug 17, 2019
@bennypowers
Copy link
Contributor

This is relevant to #7084

@stale stale bot removed the inactive label Aug 20, 2019
@stale
Copy link

stale bot commented Sep 10, 2019

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!

@stale stale bot added the inactive label Sep 10, 2019
@shilman shilman modified the milestones: 5.2.0, 5.2.x Sep 23, 2019
@stale stale bot removed the inactive label Sep 23, 2019
@Hypnosphi
Copy link
Member

Should be fixed with #8287

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

5 participants