Ever since upgrading to CRA 2.0.5 and storybook 4.x.x I have been getting this error. This was working in the previous version of storybook.
I have narrowed the issue down to destructuring an await will make the build fail.
(NOT WORKING)
const { data } = await login({ username, password: encryptedPassword })
const res = await login({ username, password: encryptedPassword })
const { data } = res
md5-72622806cffd86a7fd160db171819f32
const res = await login({ username, password: encryptedPassword })
const data = res.data
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!
@Zwerge I just released a new version that should solve your issue. Mind testing it out for me? https://github.com/storybooks/storybook/releases/tag/v4.1.0-alpha.8 Feel free to re-open this if it's still a problem.
@shilman It's working again, thanks a lot!
I'm having this exact same issue. @shilman I see the storybook release that fixes it, but I'm not sure which of the patches addresses this particular bug.
To anyone who is seeing this in the future:
Don't use babel-polyfill in your webpack configuration. Instead, add the Babel runtime and run your async/await transforms through there:
$ npm install @babel/runtime
// .babelrc, babel.config.js
plugins: [
[
'@babel/plugin-transform-runtime',
{
regenerator: true
}
]
}