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
Describe the bug
Due to nope's package.json not having "type": "module", when I try to use nope-validator with es modules I get an error SyntaxError: Cannot use import statement outside a module. My project does indeed have "type": "module" in its own package.json, the error I get only shows up when importing from 'nope-validator'. If I go to node_modules/nope-validator/package.json and just add the type field, everything works fine (but I think it wouldn't work anymore if I decided to switch to commonJs).
To reproduce
Steps to reproduce the behavior:
Create a fresh npm project, add "type": "module" to your "package.json"; Run npm install -S nope-validator ; Let the entry point be index.js. Open index.js and write:
importNopefrom'nope-validator'
Run node index.js.
Expected behavior
I expected it not to throw any errors.
Environment:
Node version: v16.16.0
The text was updated successfully, but these errors were encountered:
Describe the bug
Due to nope's package.json not having
"type": "module"
, when I try to use nope-validator with es modules I get an errorSyntaxError: Cannot use import statement outside a module
. My project does indeed have"type": "module"
in its own package.json, the error I get only shows up when importing from 'nope-validator'. If I go to node_modules/nope-validator/package.json and just add the type field, everything works fine (but I think it wouldn't work anymore if I decided to switch to commonJs).To reproduce
Steps to reproduce the behavior:
Create a fresh npm project, add
"type": "module"
to your "package.json"; Runnpm install -S nope-validator
; Let the entry point beindex.js
. Open index.js and write:Run
node index.js
.Expected behavior
I expected it not to throw any errors.
Environment:
The text was updated successfully, but these errors were encountered: