Storybook: ReferenceError: regeneratorRuntime is not defined

Created on 7 Feb 2019  路  5Comments  路  Source: storybookjs/storybook

Describe the bug
I just migrated from v5 alpha to v5 beta. Now I can see in the console: "ReferenceError: regeneratorRuntime is not defined". I've so added babel-plugin-transform-runtime to the list of my babel plugins but nothing changed (I think this include only the polyfill to my code and not to Storybook) .

To Reproduce
Steps to reproduce the behavior:

  • Storybook that work well in v5 alpha
  • Upgrade to v5 beta
  • Run Storybook
  • Blank page with error in the console

Expected behavior
Storybook that run

Screenshots
Should not be very usefull but here is the code that throw
image

System:

  • OS: [Linux]
  • Device: [All]
  • Browser: [chrome]
  • Framework: [react]
  • Version: tested with: 5.0.0-beta.1 and 5.0.0-beta-3

Thanks for reading :)

bug ui

Most helpful comment

Aha! I knew this would come to bite us! The issue is you have put in ^5.0.0-beta.3 in your package.json but a while back we released a 5.0.0-debug.3 (which matches that specifier sadly). In retrospect this was an error which we will avoid in the future.

If you change to an exact match (5.0.0.beta.3) it'll work fine.

Sorry about this!

All 5 comments

Hi @titouancreach, any chance you could upload your code somewhere?

The issue is in the ui code (ie not your code controlled by your babel config). The regenerator runtime should be part of the manager webpack config. Can you try with the latest beta (beta.3)?

Thanks for replying @tmeasday,
5.0.0-beta.3 doesn't fix this bug. I've created a minimal reproduction based on create-react-app here

馃檹 @titouancreach

You know it is interesting, I defaulted to installing via yarn and your repro worked fined. Then I saw you had a package-lock.json, installed via npm, and it failed. A bit of a hint I think 馃槈

Aha! I knew this would come to bite us! The issue is you have put in ^5.0.0-beta.3 in your package.json but a while back we released a 5.0.0-debug.3 (which matches that specifier sadly). In retrospect this was an error which we will avoid in the future.

If you change to an exact match (5.0.0.beta.3) it'll work fine.

Sorry about this!

Nice, I was wondering why storybook show "5.0.0-debug-3" in the console! Thank :)

Was this page helpful?
0 / 5 - 0 ratings