nuxt-shopify icon indicating copy to clipboard operation
nuxt-shopify copied to clipboard

Jest: node_modules/nuxt-shopify/lib/module.js

Open ckhatton opened this issue 3 years ago • 1 comments

Hi there

Since installing nuxt-shopify and running npm run test (jest), I am now receiving the error:

[fatal] Cannot use import statement outside a module

Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

Pointing to the error:

node_modules/nuxt-shopify/lib/module.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){import path from 'path';
^^^^^^

I've tried all matter of guides online to ignore it, but I can't suss it out myself.

"core-js": "^3.15.1",
"nuxt": "^2.15.3",
"nuxt-shopify": "^1.12.0"
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^27.0.5",
"jest": "^27.3.1",

ckhatton avatar Dec 17 '21 13:12 ckhatton

Do you have a small reproduction with your jest configuration?

Gomah avatar Jan 07 '22 12:01 Gomah