nextjs - 💡(How to fix) Fix Turbopack Build Error Could not parse module. [project]/node_modules/next/dist/server/route-modules/app-route/vendored/contexts/router-context.js [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#88879Fetched 2026-04-08 02:03:46
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
closed ×1commented ×1labeled ×1locked ×1

Error Message

I am using nx monorepo to setup 3 nextjs apps. my development server build (nx run app:build:development) with turbopack working fine but nx run app:build:production giving error when collecting data on prerender. Collecting page data using 11 workers ...Error: Could not parse module '[project]/node_modules/next/dist/server/route-modules/app-route/vendored/contexts/router-context.js', file not found

RAW_BUFFERClick to expand / collapse

I am using nx monorepo to setup 3 nextjs apps. my development server build (nx run app:build:development) with turbopack working fine but nx run app:build:production giving error when collecting data on prerender. Collecting page data using 11 workers ...Error: Could not parse module '[project]/node_modules/next/dist/server/route-modules/app-route/vendored/contexts/router-context.js', file not found

Environment

Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 25.2.0: Tue Nov 18 21:09:56 PST 2025; root:xnu-12377.61.12~1/RELEASE_ARM64_T6041 Available memory (MB): 24576 Available CPU cores: 12 Binaries: Node: 25.3.0 npm: 11.7.0 Yarn: 1.22.22 pnpm: N/A Relevant Packages: next: 16.1.4 // Latest available version is detected (16.1.4). eslint-config-next: 15.5.9 react: 19.2.3 react-dom: 19.2.3 typescript: 5.9.3 Next.js Config: output: N/A

NX Report Node : 25.3.0 OS : darwin-arm64 Native Target : aarch64-macos yarn : 1.22.22

nx (global) : 22.3.3 nx : 22.3.3 @nx/js : 22.3.3 @nx/eslint : 22.3.3 @nx/workspace : 22.3.3 @nx/jest : 22.3.3 @nx/cypress : 22.3.3 @nx/devkit : 22.3.3 @nx/eslint-plugin : 22.3.3 @nx/module-federation : 22.3.3 @nx/next : 22.3.3 @nx/react : 22.3.3 @nx/rollup : 22.3.3 @nx/storybook : 22.3.3 @nx/vite : 22.3.3 @nx/vitest : 22.3.3 @nx/web : 22.3.3 @nx/webpack : 22.3.3 typescript : 5.9.3

Community plugins: @webpro/nx-tsc : 0.0.2

Please help me to resolve this issue.

extent analysis

TL;DR

The issue can likely be resolved by adjusting the Next.js configuration to properly handle the prerendering process with Turbopack.

Guidance

  • Verify that the next.config.js file is correctly configured for Turbopack and prerendering.
  • Check the experimental section in next.config.js to ensure that turbo is enabled and properly configured.
  • Review the getStaticProps functions in your pages to ensure they are correctly implemented and not causing issues during prerendering.
  • Consider setting concurrentWorkers to a lower value in next.config.js to reduce the load on the system during prerendering.

Example

No specific code example can be provided without more details on the next.config.js file, but ensuring the experimental section is correctly set up is crucial:

module.exports = {
  //... other configurations
  experimental: {
    // Ensure turbo is enabled
    turbo: true,
  },
}

Notes

The exact solution may depend on the specifics of the next.config.js file and the implementation of getStaticProps in the application. The provided NX Report and environment details suggest that the issue might be related to the configuration or the version of Next.js and its dependencies.

Recommendation

Apply a workaround by adjusting the next.config.js file to properly handle prerendering with Turbopack, as upgrading to a different version of Next.js or its dependencies might not be feasible or necessary based on the provided information.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

nextjs - 💡(How to fix) Fix Turbopack Build Error Could not parse module. [project]/node_modules/next/dist/server/route-modules/app-route/vendored/contexts/router-context.js [1 comments, 2 participants]