fix(nextjs): suppress Turbopack node:crypto export-star warning - #6336
fix(nextjs): suppress Turbopack node:crypto export-star warning#6336ajnart wants to merge 1 commit into
Conversation
Next.js 16 exits with code 1 when Turbopack encounters unhandled warnings. The node:crypto CJS module triggers an 'unexpected export *' warning through the image-proxy route because node:crypto exposes its API as CJS exports only available at runtime. The named imports used at runtime are fine — this is a static analysis limitation in Turbopack's ESM/CJS interop detection. Suppress via ignoreIssue (same pattern already used for the NFT list warning) until upstream resolves the detection in vercel/next.js.
📝 WalkthroughWalkthroughChangesTurbopack configuration
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/nextjs/next.config.ts (1)
45-51: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winNarrow the suppression path.
path: "**/*"suppresses every"unexpected export *"issue, including future unrelated bundling problems. Use the resolvednode:crypto/@homarr/image-proxyorigin path if supported, or otherwise document why a global title match is unavoidable. Next.js recommends preferring specific path patterns where possible. (nextjs.org)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/nextjs/next.config.ts` around lines 45 - 51, Update the Turbopack ignore entry in the Next.js configuration to scope the "unexpected export *" suppression to the resolved node:crypto or `@homarr/image-proxy` origin path, using the supported path pattern format. Avoid the global path "**/*"; if path-specific matching is not possible, document the limitation and why the global title match is required.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/nextjs/next.config.ts`:
- Around line 45-51: Remove the ineffective turbopack.ignoreIssue entry for the
“unexpected export *” warning and address the underlying node:crypto export
issue in the image-proxy dependency, or update the build configuration so pnpm
build uses a path where the warning is not treated as a failure. Preserve the
existing named-import runtime behavior.
---
Nitpick comments:
In `@apps/nextjs/next.config.ts`:
- Around line 45-51: Update the Turbopack ignore entry in the Next.js
configuration to scope the "unexpected export *" suppression to the resolved
node:crypto or `@homarr/image-proxy` origin path, using the supported path pattern
format. Avoid the global path "**/*"; if path-specific matching is not possible,
document the limitation and why the global title match is required.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: bca7422d-96e7-466a-a2df-a5c60729975b
📒 Files selected for processing (1)
apps/nextjs/next.config.ts
| { | ||
| // node:crypto is CJS; `export *` from it triggers a Turbopack warning | ||
| // that exits 1 in Next.js 16. Named imports in image-proxy are fine at | ||
| // runtime — suppress until upstream resolves the ESM/CJS detection. | ||
| path: "**/*", | ||
| title: "unexpected export *", | ||
| }, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
rg -n '"next"\s*:' apps/nextjs/package.json package.json pnpm-lock.yaml
rg -n '"(build|dev)"\s*:' apps/nextjs/package.jsonRepository: homarr-labs/homarr
Length of output: 358
🌐 Web query:
Next.js 16 turbopack.ignoreIssue next build dev-only documentation
💡 Result:
In Next.js 16, you can suppress specific Turbopack warnings and errors using the turbopack.ignoreIssue configuration option in your next.config.js file [1][2]. This feature is intended for use with Turbopack (e.g., during next dev --turbopack) to filter noisy logs, warnings from third-party or generated code, or expected errors in the development CLI and error overlay [2][3]. The configuration requires a path pattern, and you may optionally include title or description patterns to refine the filter [3][4]. All specified fields must match for an issue to be ignored (AND logic) [3][4]. Configuration Example: import type { NextConfig } from 'next'; const nextConfig: NextConfig = { turbopack: { ignoreIssue: [ { path: '/vendor/' }, { path: 'app/', title: 'Module not found' }, { path: /generated/.*.ts/, description: /expected error/i }, ], }, }; export default nextConfig; Key Details: - Stable API: This feature was initially introduced as an experimental option (experimental.turbopackIgnoreIssue) but was graduated to the stable turbopack.ignoreIssue configuration in Next.js 16.2 [2][5]. - Path Matching: The path field accepts glob patterns (as strings) or regular expressions to match the file path where the issue originated [3][4]. - Text Matching: The title and description fields accept exact string matches or regular expressions to match the respective issue details [3][4]. - Scope: This configuration is specifically designed for the development environment when using Turbopack [3].
Citations:
- 1: https://nextjs.org/docs/app/api-reference/config/next-config-js/turbopackIgnoreIssue
- 2: https://nextjs.org/blog/next-16-2-turbopack
- 3: vercel/next.js@adcac5d
- 4: Add turbopackIgnoreIssue config to suppress Turbopack warnings vercel/next.js#89682
- 5: Turbopack: Move turbopackIgnoreIssue from experimental to turbopack.ignoreIssue vercel/next.js#89817
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
printf '\n== package.json / workspace version pins ==\n'
rg -n '"next"\s*:|catalog:' package.json pnpm-workspace.yaml pnpm-lock.yaml apps/nextjs/package.json
printf '\n== next config / build scripts ==\n'
rg -n '"build"\s*:|"dev"\s*:|next build|next dev' apps/nextjs/package.json
printf '\n== CI references to next build ==\n'
rg -n 'next build|pnpm .*build|apps/nextjs' .github apps/nextjs -g '!**/node_modules/**'
printf '\n== turbopack ignoreIssue usage ==\n'
rg -n 'ignoreIssue|turbopack' apps/nextjs .github -g '!**/node_modules/**'Repository: homarr-labs/homarr
Length of output: 25179
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
printf '\n== next.config.ts relevant section ==\n'
sed -n '1,120p' apps/nextjs/next.config.ts
printf '\n== resolved next package version in lockfile ==\n'
rg -n '(^ next@|/next@|next:|version: .*next|next@.*version:)' pnpm-lock.yaml
printf '\n== workspace catalog resolution ==\n'
sed -n '1,220p' pnpm-workspace.yaml
printf '\n== any docs or comments about turbopack cache/ignoreIssue scope ==\n'
rg -n 'turbopackFileSystemCacheForDev|ignoreIssue|Turbopack' apps/nextjs/next.config.ts .github README.md docs -g '!**/node_modules/**'Repository: homarr-labs/homarr
Length of output: 16771
🌐 Web query:
Next.js 16.2.10 next build turbopack.ignoreIssue build warnings errors
💡 Result:
In Next.js 16.2.10, you can suppress specific Turbopack warnings and errors using the turbopack.ignoreIssue configuration option in your next.config.js (or next.config.ts) file [1][2][3]. This feature was originally introduced as an experimental option (experimental.turbopackIgnoreIssue) but was moved to the stable turbopack.ignoreIssue configuration [3]. Configuration Structure The ignoreIssue option accepts an array of rules. Each rule requires a path pattern to identify the affected files and can optionally filter by issue title or description [4][5][6]. All specified fields within a rule must match for an issue to be suppressed (AND logic) [4][6]. Example Configuration // next.config.js module.exports = { turbopack: { ignoreIssue: [ // Suppress all issues in a specific directory { path: '/vendor/' }, // Suppress "Module not found" errors in the app directory { path: 'app/', title: 'Module not found' }, // Suppress errors based on regex patterns for path and description { path: /generated/.*.ts/, description: /expected error/i }, ], }, } Key Details - Path Matching: The path field supports both glob patterns (as strings) and regular expressions [4][6]. - Scope: Filtered issues are hidden from both the CLI output and the browser error overlay [1][4][5]. - Availability: This configuration is specific to Turbopack and is effective when running the development server with Turbopack (e.g., next dev --turbopack) [6].
Citations:
- 1: https://nextjs.org/docs/app/api-reference/config/next-config-js/turbopackIgnoreIssue
- 2: https://nextjs.org/blog/next-16-2-turbopack
- 3: Turbopack: Move turbopackIgnoreIssue from experimental to turbopack.ignoreIssue vercel/next.js#89817
- 4: Add turbopackIgnoreIssue config to suppress Turbopack warnings vercel/next.js#89682
- 5: Add turbopackIgnoreIssue config to suppress Turbopack warnings vercel/next.js#89682
- 6: vercel/next.js@adcac5d
🌐 Web query:
Next.js 16 next build without --turbopack does turbopack.ignoreIssue apply
💡 Result:
No, the turbopack.ignoreIssue configuration option does not apply when running next build without Turbopack [1][2]. According to the official Next.js documentation and codebase, turbopack.ignoreIssue is explicitly designed to filter out specific errors and warnings generated by Turbopack [1][3]. It is only available and functional when the application is using Turbopack, such as with next dev --turbopack [1][2]. When you run next build (without the --turbopack flag), Next.js uses its default Webpack-based build system, and any turbopack configuration in your next.config.js is ignored regarding issue suppression [2]. If you encounter errors during a standard production build, you will need to resolve them directly, as the Turbopack-specific ignore rules will not suppress them [1][2].
Citations:
- 1: https://nextjs.org/docs/app/api-reference/config/next-config-js/turbopackIgnoreIssue
- 2: vercel/next.js@b05a35a
- 3: https://nextjs.org/blog/next-16-2-turbopack
turbopack.ignoreIssue won’t suppress next build failures
pnpm build runs next build here, and this filter only applies to Turbopack. The warning will still fail CI unless the underlying export issue is fixed or the build path is changed.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/nextjs/next.config.ts` around lines 45 - 51, Remove the ineffective
turbopack.ignoreIssue entry for the “unexpected export *” warning and address
the underlying node:crypto export issue in the image-proxy dependency, or update
the build configuration so pnpm build uses a path where the warning is not
treated as a failure. Preserve the existing named-import runtime behavior.
Problem
Next.js 16 exits with code 1 when Turbopack encounters any unhandled warning, even after a successful compile. The build was failing with:
The cause is the Turbopack warning from the
image-proxy→node:cryptochain:node:cryptois a CJS module and Turbopack can't statically analyze its re-exports. The named imports (createHmac,hkdfSync) work fine at runtime — this is purely a static analysis limitation.Fix
Add the warning to the existing
turbopack.ignoreIssuelist innext.config.ts(same approach already used for the NFT list warning).Summary by CodeRabbit