You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Turbopack doesn't appear to support glob patterns that include the resource query. While the loaders themselves have access to the resource query, the extension patterns do not.
So a loader like this:
{/// ...turbopack: {rules: {"*\\?raw": {loaders: [require.resolve("./loader.js")],as: "*.js"},// This also doesn't work{"*.txt\\?raw": {loaders: [require.resolve("./loader.js")],as: "*.js"},// This doesn't work either and crashes turbopack"*?raw": {loaders: [require.resolve("./loader.js")],as: "*.js"}*/}}}
Does not work.
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.6.0: Fri Jul 5 17:56:15 PDT 2024; root:xnu-10063.141.1~2/RELEASE_ARM64_T6031
Available memory (MB): 65536
Available CPU cores: 16
Binaries:
Node: 22.14.0
npm: 10.9.2
Yarn: 1.22.22
pnpm: N/A
Relevant Packages:
next: 15.4.0-canary.36 // Latest available version is detected (15.4.0-canary.36).
eslint-config-next: N/A
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
There doesn't appear to be a workaround here. I thought I might be able to write a custom loader that would pitch, interrogate the resource query, and then grab the resource if it matched but I have no way to override the loaders and the data in pitch is an empty object.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Link to the code that reproduces this issue
https://github.com/iamnafets/next-resourcequery/tree/main/reproduction-app
To Reproduce
yarn dev --turbo
/
note theUnknown module type
error.yarn dev
Current vs. Expected behavior
Turbopack doesn't appear to support glob patterns that include the resource query. While the loaders themselves have access to the resource query, the extension patterns do not.
So a loader like this:
Does not work.
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.6.0: Fri Jul 5 17:56:15 PDT 2024; root:xnu-10063.141.1~2/RELEASE_ARM64_T6031 Available memory (MB): 65536 Available CPU cores: 16 Binaries: Node: 22.14.0 npm: 10.9.2 Yarn: 1.22.22 pnpm: N/A Relevant Packages: next: 15.4.0-canary.36 // Latest available version is detected (15.4.0-canary.36). eslint-config-next: N/A 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
There doesn't appear to be a workaround here. I thought I might be able to write a custom loader that would pitch, interrogate the resource query, and then grab the resource if it matched but I have no way to override the loaders and the
data
in pitch is an empty object.The text was updated successfully, but these errors were encountered: