How to use ts-node regardless of errors?

ts-node has a –transpile-only (or -T) argument. It will ignore all type errors and just build your project. My 2022 suggestion for this to set up esbuild instead. Not a plug and play experience, but extremely fast. We use esbuild for (constant) building during development, and rely on other tools to report type errors.

ts-node and mocha ‘TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension “.ts”‘ error even with “ts-node/esm” loader and CommonJS modules

i’m using same configuration like yours but it only work when i downgrade to ts-node@9, and then i tried this option in my .mocharc.json and now it’s working as i expected { “extensions”: [“ts”], “spec”: [“**/*.spec.*”], “node-option”: [ “experimental-specifier-resolution=node”, “loader=ts-node/esm” ] }

ts-node execute typescript with module import and module defined

The Error Warning: To load an ES module, set “type”: “module” in the package.json or is caused by the following Bug in ts-node: https://github.com/TypeStrong/ts-node/issues/935 The Bug is closed, and there is a proposal to solve it, but it is still open: https://github.com/TypeStrong/ts-node/issues/1007 I don’t need “type”: “module” in package.json. In tsconfig.json, I’m using using “module”: … Read more

Ts-node : SyntaxError: Cannot use import statement outside a module

After a lot of searching, I found this solution works perfect: https://github.com/TypeStrong/ts-node/issues/922#issuecomment-673155000 Just add a “ts-node” block to your tsconfig.json file as below: { “ts-node”: { “compilerOptions”: { “module”: “commonjs” } }, “compilerOptions”: { “module”: “esnext” } } And it has been documented in the ts-node official page “Via tsconfig.json” part. This saved hours of … Read more

tech