-
-
Notifications
You must be signed in to change notification settings - Fork 733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vite throws 'Uncaught ReferenceError: regeneratorRuntime is not defined' #227
Comments
This still happens with version 3.6.5 which has #223. Dependencies
Only works when using version |
The problem still exists with version 3.7.0. |
Issues are not related. To fix this one you will have to use the See this discussion on a similar issue with Here, I solved it by installing |
@HugoBDev that's for the suggestion. Importing Maybe this is something that can be added to the docs. |
I have tried out react-location a while back with vite and didn't encounter this issue. What changes that made importing |
This issue was fixed with #236 |
Still happening in vite 4.0.2 |
Still happening in vite 4.3.9 |
It is still there! vite 4.4.0 |
Try this way: Then copy this code to import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import legacy from '@vitejs/plugin-legacy'
import babel from 'vite-plugin-babel'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
legacy({
targets: ['defaults', 'not IE 11'],
additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
}),
babel({
babelConfig: {
babelrc: false,
configFile: false,
plugins: ['@babel/plugin-transform-runtime'],
}
})
],
}) |
When using React Table, if your code uses async/await syntax, you need to introduce the regenerator-runtime library into the project.
|
Describe the bug
Uncaught ReferenceError: regeneratorRuntime is not defined when using react-location with Vite.
To Reproduce
Steps to reproduce the behavior:
yarn create vite --template react-ts
yarn
yarn add @tanstack/react-location
App.tsx
with code belowyarn dev
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: