Skip to content

Turbopack: resourceQuery is empty for import URLs that are remapped in TypeScript #71959

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
Yihao-G opened this issue Oct 28, 2024 · 0 comments
Labels
bug Issue was opened via the bug report template. linear: turbopack Confirmed issue that is tracked by the Turbopack team. Turbopack Related to Turbopack with Next.js.

Comments

@Yihao-G
Copy link

Yihao-G commented Oct 28, 2024

Link to the code that reproduces this issue

https://codesandbox.io/p/github/kdy1/repro-next-69502/csb-pl26sn/draft/modest-bassi

To Reproduce

  1. Have Turbopack configured to load *.mdx file with a custom loader
  2. Created a file in the root folder: /assets/test.mdx
  3. Update tsconfig.json's compilerOptions.paths to add "assets/*": ["./assets/*"]
  4. Import the mdx file in a component:
import { v } from "assets/test.mdx?test";
  1. Inside the custom loader, this.resourceQuery is empty

Current vs. Expected behavior

Current:

this.resourceQuery is empty

Expected:

this.resourceQuery should be ?test.

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
  Available memory (MB): 4102
  Available CPU cores: 2
Binaries:
  Node: 20.12.0
  npm: 10.5.0
  Yarn: 1.22.19
  pnpm: 8.15.6
Relevant Packages:
  next: 15.0.2-canary.9 // Latest available version is detected (15.0.2-canary.9).
  eslint-config-next: 14.1.0
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.3.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

Disable Turbopack and use the identical Webpack configuration, this.resourceQuery gives the correct result of ?test.

Related issue: #69502
Related PR: #69703

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. linear: turbopack Confirmed issue that is tracked by the Turbopack team. Turbopack Related to Turbopack with Next.js.
Projects
None yet
Development

No branches or pull requests

3 participants
@timneutkens @Yihao-G and others