happo / happo-plugin-storybook

A happo.io plugin for Storybook
MIT License
11 stars 5 forks source link

Uncaught ReferenceError: regeneratorRuntime is not defined #8

Closed jack-sf closed 5 years ago

jack-sf commented 5 years ago

After bumping from 2.0.0 to 2.0.1 we get following error:

Uncaught ReferenceError: regeneratorRuntime is not defined at Object../node_modules/happo-plugin-storybook/register.js (iframe.bundle.js:55146) at webpack_require (iframe.bundle.js:725) at fn (iframe.bundle.js:102) at Module../storybook/config.js (iframe.bundle.js:209699) at webpack_require (iframe.bundle.js:725) at fn (iframe.bundle.js:102) at Object.0 (iframe.bundle.js:224636) at __webpack_require__ (iframe.bundle.js:725) at iframe.bundle.js:792 at iframe.bundle.js:795

https://www.dropbox.com/s/og380j98umij791/Screenshot%202019-01-24%2010.38.25.png?dl=0

This fatal error causes our stories not to render at all (at least in non-happo mode): https://www.dropbox.com/s/jpkvwqeouegpci4/Screenshot%202019-01-24%2010.43.53.png?dl=0 .

FYI, we use Storybook 4.0.7, with following webpack and babel setup .


Side notes:

At 2.0.0 we had noticed that our storybook failed to run on IE11, even when Happo was disabled.

Right now our storybook config looks like that:

import { isHappoRun } from 'happo-plugin-storybook/register';

if (isHappoRun()) {
  require('./config.happo');
} else {
  require('./config.default');
}

Unfortunately, it seems like just importing the isHappoRun function brings a lot of dependencies to our codebase.

Thus, maybe the isHappoRun could be extracted to some separate file, which wouldn't result in importing all of the happo deps on a non-happo build? (Controlling it with a env variable that is always present when in a happo mode, maybe would be a better solution. Just thinking out loud.)

jack-sf commented 5 years ago

One of the solutions for this is upgrading storybook to newest version, as i.e. https://github.com/storybooks/storybook/releases/tag/v4.1.9 has some fixes for IE11. Updating to 4.1.9 fixed this for us.

jack-sf commented 5 years ago

The original issue is fixed. The note about extracting isHappoRun to separate file, I'll move it to a separate issue if still valid.