Open golergka opened 2 years ago
Just ran into the same issue (using Node 16 and ts-node v8.10.2):
/t/node_modules/node-icecream/node_modules/acorn/dist/acorn.js:2757
var err = new SyntaxError(message);
^
SyntaxError: 'import' and 'export' may appear only with 'sourceType: module' (1:0)
at Parser.pp$4.raise (/t/node_modules/node-icecream/node_modules/acorn/dist/acorn.js:2757:13)
at Parser.pp$1.parseStatement (/t/node_modules/node-icecream/node_modules/acorn/dist/acorn.js:799:16)
at Parser.pp$1.parseTopLevel (/t/node_modules/node-icecream/node_modules/acorn/dist/acorn.js:706:23)
at Parser.parse (/t/node_modules/node-icecream/node_modules/acorn/dist/acorn.js:551:15)
at Object.parse (/t/node_modules/node-icecream/node_modules/acorn/dist/acorn.js:5290:37)
at getOriginalArguments (/t/node_modules/node-icecream/index.js:30:24)
at icWithArguments (/t/node_modules/node-icecream/index.js:48:29)
at ic (/t/node_modules/node-icecream/index.js:80:16)
at Object.<anonymous> (/t/t.ts:4:1)
at Module._compile (node:internal/modules/cjs/loader:1198:14)
using the following minimal test:
import ice from 'node-icecream'
const ic = ice({ prefix: 'TS: '})
const o1 = { a: 1 }
ic(o1)
Im having also this error
Here's what I'm trying to do:
And here's what I get:
It happens when I run tests through jest. My project uses Typescript and
ts-jest
to run typescript test files.