ts-node@7 ignores my custom module declarations

Created on 30 Jun 2018  Â·  4Comments  Â·  Source: TypeStrong/ts-node

ts-node@7 doesn't work with custom module declaration file, but ts-node@6 works fine with the same project:

Here are my files:

1) /tsconfig.json

{
  "compilerOptions": {
    "target": "es6",
    "module": "commonjs",
    "lib": ["es2017", "dom"],
    "sourceMap": true,
    "outDir": "./dist",
    "strict": true,
    "moduleResolution": "node",
    "noUnusedLocals": true,
    "noUnusedParameters": true
  },
  "include": ["src/**/*", "scripts/**/*"]
}

2) My custom module declarations, /src/typings.d.ts

declare module "ethereumjs-tx"
declare module "agendash"

3) Script line from package.json, how I run it:
"start": "nodemon --watch src --ext ts --exec ts-node src"

It works fine with ts-node@6, also it compiles with tsc.

But with ts-node@7 there is an error:

TSError: ⨯ Unable to compile TypeScript:\
src/utils/ethereum.utils.ts(3,21): error TS7016: Could not find a declaration file for module 'ethereumjs-tx'

invalid

Most helpful comment

@Haxified1

With a new version of ts-node I've changed for my projects:
ts-node@6: ts-node src/index.ts
ts-node@7: ts-node --files src/index

All 4 comments

Please search existing issues, read the changelog, read the README before opening a duplicate issue.

@blakeembrey maybe say what it is a duplicate of?

@Haxified1 On mobile it would take me a long time and I'm continuously repeating myself. Should the onus not be on the person reporting to deduplicate? Here's a link to the last closed related issues: https://github.com/TypeStrong/ts-node/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aclosed+files

@Haxified1

With a new version of ts-node I've changed for my projects:
ts-node@6: ts-node src/index.ts
ts-node@7: ts-node --files src/index

Was this page helpful?
0 / 5 - 0 ratings

Related issues

OliverJAsh picture OliverJAsh  Â·  3Comments

mattdell picture mattdell  Â·  4Comments

dakom picture dakom  Â·  3Comments

KiaraGrouwstra picture KiaraGrouwstra  Â·  3Comments

grissius picture grissius  Â·  3Comments