Theo's Typesafe CultTTC
Theo's Typesafe Cult3y ago
76 replies
fotoflo

tsconfig and import statements

All my tests (of the modules) are using import statements...
However once i put an import statement in the index.ts i get this error:

$ ts-node index.ts
(node:32890) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
-> import runBatch from "src/runBatch";


Relivant lines in tsconfig.ts:
    "target": "ES2020",
    "lib": ["ES2020"],
    "module": "ES2020",
Was this page helpful?