rollup-plugin-workbox 5.2.0 error: [!] SyntaxError: Cannot use import statement outside a module
See original GitHub issueMy builds failed on this newest version of the plugin. The full error was:
[!] SyntaxError: Cannot use import statement outside a module
C:\D2L\personal\brightspaceui-core-bundler\node_modules\rollup-plugin-workbox\dist\index.js:1
import { generateSW as _generateSw, injectManifest as _injectManifest, } from 'workbox-build';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:1054:16)
at Module._compile (internal/modules/cjs/loader.js:1102:27)
at Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Object.require.extensions.<computed> [as .js] (C:\D2L\personal\brightspaceui-core-bundler\node_modules\rollup\dist\shared\loadConfigFile.js:511:13)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (C:\D2L\personal\brightspaceui-core-bundler\node_modules\@open-wc\building-rollup\src\createSpaConfig.js:9:24)
at Module._compile (internal/modules/cjs/loader.js:1138:30)
Reverting to version 5.1.0
solved the issue. Do I need to change something to work with the newest version of the plugin?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
SyntaxError: Cannot use import statement outside a module
But that gets me another error: "Error: Plugin/Preset files are not allowed to export objects, only functions." Here are the dependencies I ...
Read more >SyntaxError: Cannot use import statement outside a module ...
When you use ECMAScript Modules in Node (v13.6.0 for me) combined with Jest, the following error occurs: SyntaxError: Cannot use import ...
Read more >How to Fix "SyntaxError: Cannot use import statement outside ...
In this post, we'll learn more about the "SyntaxError: Cannot use import statement outside a module" error and how to fix it in...
Read more >Cannot use import statement outside a module [React ...
In this article, you'll learn how to fix the SyntaxError: Cannot use import statement outside a module error when using TypeScript or JavaScript ......
Read more >SyntaxError: Cannot use import statement outside a module
SyntaxError : Cannot use import statement outside a module ... Debugger attached. (node:11959) Warning: To load an ES module, set "type": "module" in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for fixing that @thepassle it works now!
Thanks for reporting, and sorry about that! This should be fixed in https://github.com/modernweb-dev/web/pull/407