Turbopack import.meta.glob fails for parent-relative patterns in server modules
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.4k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
Link to the code that reproduces this issue
https://github.com/chitwitgit/turbopack-import-meta-glob
To Reproduce
- Clone https://github.com/chitwitgit/turbopack-import-meta-glob
- Run
npm install - Run
npm run build— build succeeds - Run
npm run start - Visit
/andGET /api/hello
Alternatively:
npm run dev
curl http://localhost:3000/api/hello
Current vs. Expected behavior
Expected: import.meta.glob is officially supported by Turbopack in Next.js 16.3 and should follow Vite-compatible importer-relative path semantics.
In this repro:
- the Server Component page should resolve
./page-modules/*.jsto["page-local-module"] - the Server Component page should resolve
../lib/modules/*.jsto["example-module"] - the App Route should resolve
./modules/*.jsto["local-module"] - the App Route should resolve
../../../lib/modules/*.jsto["example-module"]
/api/hello should return:
{
"localValues": ["local-module"],
"parentValues": ["example-module"]
}
The page should render:
page-local-values:["page-local-module"]page-parent-values:["example-module"]
Actual on Next.js 16.3 canary (16.3.0-canary.78):
next buildandnext devsucceed- the local control glob works in both the Server Component page and the App Route
- the parent-relative glob matches nothing in both places
/api/helloreturns:
{
"localValues": ["local-module"],
"parentValues": []
}
- the page renders:
page-local-values:["page-local-module"]page-parent-values:[]
So this looks specific to parent-directory traversal in server-side import.meta.glob resolution, not a generic import.meta.glob failure.
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.6.0: Wed Nov 5 21:34:00 PST 2025; root:xnu-11417.140.69.705.2~1/RELEASE_ARM64_T8132
Available memory (MB): 24576
Available CPU cores: 10
Binaries:
Node: 22.19.0
npm: 11.17.0
Yarn: 1.22.22
pnpm: 10.33.4
Relevant Packages:
next: 16.3.0-canary.78 // Latest available version is detected (16.3.0-canary.78).
eslint-config-next: N/A
react: 19.2.7
react-dom: 19.2.7
typescript: N/A
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Turbopack, Module Resolution, Route Handlers
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Vercel (Deployed)
Additional context
import.meta.globis officially supported in Next.js 16.3 (Turbopack only).- Vite-compatible semantics allow importer-relative parent traversal.
- This repro demonstrates the same failure in both a Server Component and an App Route.
- Related prior work: #92640, #92729.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked turbopack-import-meta-glob reproduction: run npm install, npm run build, and npm run start, then request / and /api/hello, or use npm run dev with curl. Compare parent-relative import.meta.glob behavior in the Server Component page and App Route against the stated arrays and JSON/page output; done means parent traversal resolves the expected example-module values in both modes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nextjs
- Domain
- api, build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100