oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.87k stars 2.74k forks source link

FileNotFound when tsconfig.json `"extends"` package #5277

Open golamrabbiazad opened 1 year ago

golamrabbiazad commented 1 year ago

What version of Bun is running?

1.0.1

What platform is your computer?

Linux 6.2.0-32-generic x86_64 x86_64

What steps can reproduce the bug?

bunx --bun astro dev command shows the warn: FileNotFound loading tsconfig.json extends "/home/user/Desktop/sandwch-burner/astro/tsconfigs/strictest"

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

KyTiXo commented 1 year ago

For anyone else, I was able to resolve this specifying the exact path in my tsconfig.json

{
  "extends": "./node_modules/astro/tsconfigs/strict.json",
  "compilerOptions": {

  }
}
golamrabbiazad commented 1 year ago

This issue is now solved in Bun v1.0.2. :tada:

aralroca commented 4 months ago

I can reproduce the same bug with Bun 1.1.13 😢 Takes hours to identify the problem...

JakeElder commented 1 month ago

I'm also having this issue, but it fails silently

tsconfig.json

// Doesn't work
{
  "extends": "@2pm/config/tsconfig.base.json"
}
// Works
{
  "extends": "./node_modules/@2pm/config/tsconfig.base.json"
}

This is via a script from the workspace

package.json

{
  "name": "@2pm/workspace",
  "scripts": {
    "generate:openapi-spec": "bun scripts/generate-openapi-spec.ts",
  },
  "workspaces": [
    "apps/*",
    "packages/*"
  ]

The script runs, but it produces an error as a required tsconfig option is missing ("emitDecoratorMetadata": true)

Copying the contents of ./packages/config/tsconfig.base.json to ./tsconfig.json, or replacing the extension path with the relative path (including ./node_modules) results in the script running correctly

Bun version: 1.1.27