Skip to content

Custom typings not working with ts-node 8.0.2 #782

@p-kuen

Description

@p-kuen

After updating to ts-node version 8.0.2 the custom typings (currently placed in ./types) don't work anymore.
When I am changing the version to 8.0.1 the typings are working fine.

Typescript version: 3.3.3

Current tsconfig.json:

{
  "compilerOptions": {
    "sourceMap": true, // allow sourcemap support
    "strictNullChecks": true, // enable strict null checks as a best practice
    "strict": true,
    "target": "esnext", // specify ECMAScript target version
    "module": "commonjs",
    "moduleResolution": "node",
    "noImplicitAny": true,
    "declaration": false,
    "typeRoots": ["./@types"],
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "outDir": "./build"
  },
  "include": ["./src/", "./types"],
  "exclude": ["node_modules", ".logs", "upload"]
}

Error Message:

uncaughtException: ⨯ Unable to compile TypeScript:
src/import/law.ts(2,28): error TS7016: Could not find a declaration file for module 'csv-string'. '/home/patrick/dev/bodner-api/node_modules/csv-string/index.js' implicitly has an 'any' type.
  Try `npm install @types/csv-string` if it exists or add a new declaration (.d.ts) file containing `declare module 'csv-string';`

TSError: ⨯ Unable to compile TypeScript:
src/import/law.ts(2,28): error TS7016: Could not find a declaration file for module 'csv-string'. '/home/patrick/dev/bodner-api/node_modules/csv-string/index.js' implicitly has an 'any' type.
  Try `npm install @types/csv-string` if it exists or add a new declaration (.d.ts) file containing `declare module 'csv-string';`

    at createTSError (/home/patrick/dev/bodner-api/node_modules/ts-node/src/index.ts:228:12)
    at getOutput (/home/patrick/dev/bodner-api/node_modules/ts-node/src/index.ts:334:40)
    at Object.compile (/home/patrick/dev/bodner-api/node_modules/ts-node/src/index.ts:367:11)
    at Module.m._compile (/home/patrick/dev/bodner-api/node_modules/ts-node/src/index.ts:413:43)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.require.extensions.(anonymous function) [as .ts] (/home/patrick/dev/bodner-api/node_modules/ts-node/src/index.ts:416:12)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions