-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Description
What happens?
(cross-posting from babel/babel#14568 (comment))
At line 445 of https://unpkg.com/browse/dva-core@2.0.4/dist/index.js, dva-core uses the regeneratorRuntime global (which is injected by Babel). However, that global variable is not defined anywhere.
There are three possible fixes:
- Add
require("regenerator-runtime"), which defines the globalregeneratorRuntimevariable so that it can be used - Use
@babel/plugin-transform-runtimeto inject the necessary@babel/runtimeimports - Update
@babel/coreand@babel/plugin-transform-regeneratorto ^7.18.0, so that the compiled output doesn't rely on aregeneratorRuntimeglobal anymore.
Surprisingly, the ESM build already follows the 2nd solution and thus isn't affected by this bug. You can see at line 316 of https://unpkg.com/browse/dva-core@2.0.4/dist/index.esm.js that it uses the local _regeneratorRuntime variable, imported at line 17.
Mini Showcase Repository(REQUIRED)
Context
- Dva Version: 2.0.4
- Node Version: doesn't matter
- Platform: doesn't matter
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels