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

Cryptic error on invalid tsconfig.json, e.g. if attempting to extend nonexistent tsconfig file #2111

Open
dandv opened this issue Mar 10, 2024 · 0 comments

Comments

@dandv
Copy link

dandv commented Mar 10, 2024

Search Terms

Function: [nodejs.util.inspect.custom]

Expected Behavior

This bug arose after I renamed a base tsconfig-base.json file, and the tsconfig.json in my monorepo subdir was doing an "extends": "../tsconfig-base.json". The tsconfig.json was syntactically valid, but ../tsconfig-base.json was not found. Turns out that any error with tsconfig.json will produce the cryptic error below.

Actual Behavior

$ node --loader=ts-node/esm -e 'console.log(1)'

node:internal/process/esm_loader:40
      internalBinding('errors').triggerUncaughtException(
                                ^
[Object: null prototype] {
  [Symbol(nodejs.util.inspect.custom)]: [Function: [nodejs.util.inspect.custom]]
}

Node.js v18.19.0

Steps to reproduce the problem

  1. Create an invalid tsconfig.json, e.g. { 1 }
  2. Run node --loader=ts-node/esm -e 'console.log(1)'

Specifications

  • ts-node version: 10.9.1
  • node version: 18.19.0
  • TypeScript version: 5.3.3
  • tsconfig.json, if you're using one:
{ 1 }
  • package.json:
{ "type": "module" }
  • Operating system and version: Fedora Linux 38
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

1 participant