-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
Labels
TurbopackRelated to Turbopack with Next.js.Related to Turbopack with Next.js.bugIssue was opened via the bug report template.Issue was opened via the bug report template.linear: turbopackConfirmed issue that is tracked by the Turbopack team.Confirmed issue that is tracked by the Turbopack team.locked
Description
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/5gxwzd
To Reproduce
- Copy
test-loader.jsintonode_modulesso it can be resolved by Turbopack correctly - Run the app in dev mode
- The received
resourceQuerywill be printed to terminal
Current vs. Expected behavior
I imported the file with:
import file from "./test.mdx?test=hi"`On my MDX loader, the received resourceQuery is always empty, even if query is set.
Normally, it should pass ?test=hi to the loader, same as Webpack.
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.9.0
npm: 9.8.1
Yarn: 1.22.19
pnpm: 8.10.2
Relevant Packages:
next: 14.2.7 // Latest available version is detected (14.2.7).
eslint-config-next: 14.1.0
react: 18.2.0
react-dom: 18.2.0
typescript: 5.3.3
Next.js Config:
output: N/AWhich area(s) are affected? (Select all that apply)
Turbopack
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
I'm migrating Fumadocs to Turbopack.
For performance optimizations, I need to access the hash from resourceQuery:
import file from "./index.mdx?hash=0001"Because the MDX loader bundles and executes the configuration file (TypeScript file) to obtain MDX options. To support auto-reload on the config file, every change to the config file will change the hash of MDX file import:
- import file from "./index.mdx?hash=0001"
+ import file from "./index.mdx?hash=0002"Then, Turbopack will invoke MDX loaders again to re-compile the files. With the hash, we can determine if the config has updated, and reload the config if necessary.
Metadata
Metadata
Assignees
Labels
TurbopackRelated to Turbopack with Next.js.Related to Turbopack with Next.js.bugIssue was opened via the bug report template.Issue was opened via the bug report template.linear: turbopackConfirmed issue that is tracked by the Turbopack team.Confirmed issue that is tracked by the Turbopack team.locked