Storybook: Module build failed (from ./node_modules/babel-loader/lib/index.js): TypeError: Property name expected type of string but got null

Created on 29 Oct 2018  路  5Comments  路  Source: storybookjs/storybook

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
react cra question / support

All 5 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!

@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
    }
  ]
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexanbj picture alexanbj  路  3Comments

arunoda picture arunoda  路  3Comments

levithomason picture levithomason  路  3Comments

purplecones picture purplecones  路  3Comments

ZigGreen picture ZigGreen  路  3Comments