Skip to content
Source
Sign inSign up
TanStack/query

ReferenceError: regeneratorRuntime is not defined #7

ClosedJaceHensley(GitHub profile, opens in a new tab) opened this issue 8 comments

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.

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

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

  3. tannerlinsley closed this

  4. dusty(GitHub profile, opens in a new tab)commented

    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'
            }
          },
  5. My build is a webpack build using babel-loader with the preset used in CRA with Typescript enabled

  6. I’m also using CRA in the example. Link to your project?

    Tanner Linsley On Oct 30, 2019, 8:43 PM -0600, JaceHensley <notifications@github.com>, wrote:

    My build is a webpack build using babel-loader with the preset used in CRA with Typescript enabled — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

  7. 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

  8. 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

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

Sign in to join this conversation.