Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Turbopack] tsconfig's baseUrl is not respected wrt paths config #78394

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

Open
Yonom opened this issue Apr 22, 2025 · 1 comment
Open

[Turbopack] tsconfig's baseUrl is not respected wrt paths config #78394

Yonom opened this issue Apr 22, 2025 · 1 comment
Labels
Turbopack Related to Turbopack with Next.js.

Comments

@Yonom
Copy link

Yonom commented Apr 22, 2025

Link to the code that reproduces this issue

https://github.com/Yonom/turborepo-bug-report

To Reproduce

next dev --turbo

Image

Current vs. Expected behavior

Expected: next dev --turbo should not result in a build error, if next dev (without turbopack) compiles.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 22.14.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 10.9.0
Relevant Packages:
  next: 15.3.1 // Latest available version is detected (15.3.1).
  eslint-config-next: 15.3.1
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.8.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Turbopack

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

I use a shared tsconfig.base.json with path aliases like:

{
  "compilerOptions": {
    "paths": {
      "@/*": ["./*"],
      "package1": ["./packages/package1/src"],
      "package2": ["./packages/package2/src"]
    }
  }
}

Each project extends this base config and sets its own baseUrl:

{
  "extends": "../../tsconfig.base.json",
  "compilerOptions": {
    "baseUrl": "."
  }
}

This setup works with tsc, but Turbopack fails.

@timneutkens
Copy link
Member

Tried to reproduce this based on the reproduction repository but I'm guessing it does not reproduce because the tsconfig.base.json is in a directory under the main project but what you're saying is that those would be a parent directory.

Can you have a look at this sandbox running the repository: https://codesandbox.io/p/github/Yonom/turborepo-bug-report/csb-qth2dy/draft/compassionate-resonance?file=%2Ftsconfig.json%3A11%2C20

And make edits so that it reproduces? Then we can make sure that the case is handled.

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

No branches or pull requests

2 participants