You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Importing the module works as it does in StackBlitz SvelteKit example
Current Behavior
After importing the dependency, multiple errors are thrown about cookieconsent being a CommonJS module:
SyntaxError: [vite] Named export 'run' not found. The requested module 'vanilla-cookieconsent' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'vanilla-cookieconsent';
const {run} = pkg;
[multiple similar errors...]
the workarounds provided by the error messages are ineffective.
Steps to reproduce
Generate a new SvelteKit 2.x project, using Node 20.x
Recreate the StackBlitz example
Proposed fix or additional info.
Since this is an ES module, the following property should be set inside package.json: "type": "module",
Without this property, Node considers this to be a CommonJS module and throws multiple errors.
Note: I assume this behaviour was introduced between Node 18.18 and 20.x, as it works on Node 18 on StackBlitz
Version
3.0.0
On which browser do you see the issue?
Other
The text was updated successfully, but these errors were encountered:
Expected Behavior
Importing the module works as it does in StackBlitz SvelteKit example
Current Behavior
After importing the dependency, multiple errors are thrown about cookieconsent being a CommonJS module:
the workarounds provided by the error messages are ineffective.
Steps to reproduce
Generate a new SvelteKit 2.x project, using Node 20.x
Recreate the StackBlitz example
Proposed fix or additional info.
Since this is an ES module, the following property should be set inside
package.json:
"type": "module",
Without this property, Node considers this to be a CommonJS module and throws multiple errors.
Note: I assume this behaviour was introduced between Node 18.18 and 20.x, as it works on Node 18 on StackBlitz
Version
3.0.0
On which browser do you see the issue?
Other
The text was updated successfully, but these errors were encountered: