Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When running with extends for Node 14 I get not found #74

Open
awentzel opened this issue Sep 23, 2021 · 5 comments
Open

When running with extends for Node 14 I get not found #74

awentzel opened this issue Sep 23, 2021 · 5 comments

Comments

@awentzel
Copy link

When extending my TypeScript configuration using node 14 I'm getting an error when using VS Code debugger.

File '@tsconfig/node14/tsconfig.json' not found.

tsconfig.json file contents:

{
  "extends": "@tsconfig/node14/tsconfig.json",
  "compilerOptions": {
    "esModuleInterop": true,
    "noEmitOnError": true,
    "outDir": "dist",
    "removeComments": false,
    "resolveJsonModule": true,
    "rootDir": ".",
    "sourceMap": true,
  },
  "include": [
    "**/*.ts",
    "**/*.spec.ts"
  ],
  "exclude": [
    "node_modules",
    "dist/*"
  ]
}

package.json file content excerpt:

  "devDependencies": {
    "@graphql-codegen/cli": "^2.2.0",
    "@graphql-codegen/introspection": "^2.1.0",
    "@graphql-codegen/typescript": "^2.2.2",
    "@graphql-codegen/typescript-resolvers": "^2.2.1",
    "@tsconfig/node14": "^1.0.1",
    "azure-functions-core-tools": "^3.0.3734",
    "typescript": "^4.4.3"
  }

Package listing:

├── @tsconfig/node14@1.0.1 
└─┬ ts-node@10.2.1
  └── @tsconfig/node14@1.0.1  deduped
@awentzel
Copy link
Author

When I update the path to include node_modules "extends": "./node_modules/@tsconfig/node14/tsconfig.json", the error goes away.

Is this intended? Should the documentation be updated? Perhaps I'm missing something. Thanks

@Jaimeloeuf
Copy link

I get the same issue for node16 base config, is this intended? Because if so the documentation should probably be updated. Thanks!

@orta
Copy link
Member

orta commented Feb 25, 2022

Sounds like a bug in whatever is resolving the path to me? Might need to file a repro to the TypeScript repo?

@jasonburrows
Copy link

I get this for node 16, but strangely it was working as expected until maybe 2 weeks ago and now the same repo on the same two computers gives the error:

File '@tsconfig/node16/tsconfig.json' not found.

Only thing I can think of that changed since it worked is I updated to macOS 12.6.

@RobinTail
Copy link
Contributor

RobinTail commented Nov 27, 2023

I suppose it happens in some versions of Typescript when node_modules is excluded by the combination of include/exclude options in tsconfig.json, making @tsconfig/node* being no longer resolved from that folder automatically.

  "extends": "@tsconfig/node14/tsconfig.json",
  "include": [
    "**/*.ts",
    "**/*.spec.ts"
  ],
  "exclude": [
    "node_modules",       <—
    "dist/*"
  ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants