Skip to content

ReferenceError: regeneratorRuntime is not defined #7

Closed

Description

@JaceHensley

When running this I'm hitting the error ReferenceError: regeneratorRuntime is not defined. I think this has to do with how the library is being built. You can work around this by configuring babel but that seems like a lot of overhead for consumers.

Activity

  1. tannerlinsley commented on Oct 8, 2019

    @tannerlinsley
    Member

    I'll double check the babel implementation, but it should be including all of that in the build.

  2. tannerlinsley commented on Oct 31, 2019

    @tannerlinsley
    Member

    Double checked and this should be fine as is. This is likely because you are compiling to a target that needs babel-polyfill.

  3. dusty commented on Oct 31, 2019

    @dusty

    I'm having the same issue. Here is my browserlistrc. Any suggestions on how to get this working?

    > 1%
    not op_mini all
    not dead
    not ie 11
    

    here is my babel config

    module.exports = function(api) {
      api.cache(true)
    
      const presets = [
        ['@babel/preset-env', { useBuiltIns: 'entry', corejs: 3 }],
        ['@babel/preset-react']
      ]
    
      const plugins = ['react-hot-loader/babel', 'babel-plugin-styled-components']
    
      return { presets, plugins }
    }
    

    relevant webpack section

      {
            test: /.(js|jsx)$/,
            exclude: /node_modules/,
            use: {
              loader: 'babel-loader'
            }
          },
    
  4. JaceHensley commented on Oct 31, 2019

    @JaceHensley
    Author

    My build is a webpack build using babel-loader with the preset used in CRA with Typescript enabled

  5. tannerlinsley commented on Oct 31, 2019

    @tannerlinsley
    Member
  6. JaceHensley commented on Oct 31, 2019

    @JaceHensley
    Author

    Unfortunately it's a closed source app, but I'll take a stab at making a reproducible test case, I'll start with the example in this repo

  7. JaceHensley commented on Nov 1, 2019

    @JaceHensley
    Author

    Okay I think I see what the problem is. So I'm not using CRA but my own webpack.config.ts that is inspired by CRA but I don't have the react-app-polyfill stuff. I already have a polyfill.ts so I should be able to add the babel ones there

  8. vikasaditya commented on Jan 4, 2020

    @vikasaditya

    This comes everytime in nextjs projects. Heres the link to sandbox https://codesandbox.io/s/nifty-saha-s2k7d . Tried in local also same result.

  9. added a commit that references this issue on Jun 5, 2021
  10. added a commit that references this issue on Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions