Skip to content

fix(nextjs): suppress Turbopack node:crypto export-star warning - #6336

Open
ajnart wants to merge 1 commit into
devfrom
fix/turbopack-crypto-warning
Open

fix(nextjs): suppress Turbopack node:crypto export-star warning#6336
ajnart wants to merge 1 commit into
devfrom
fix/turbopack-crypto-warning

Conversation

@ajnart

@ajnart ajnart commented Jul 14, 2026

Copy link
Copy Markdown
Member

Problem

Next.js 16 exits with code 1 when Turbopack encounters any unhandled warning, even after a successful compile. The build was failing with:

✓ Compiled successfully in 99s
  Skipping validation of types
[ELIFECYCLE] Command failed with exit code 1.

The cause is the Turbopack warning from the image-proxynode:crypto chain:

[externals]/node:crypto
unexpected export *
export * used with module [externals]/node:crypto [external] (node:crypto, cjs)

node:crypto is 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.ignoreIssue list in next.config.ts (same approach already used for the NFT list warning).

Summary by CodeRabbit

  • Bug Fixes
    • Resolved a build-time issue that could cause Turbopack to fail when processing certain wildcard exports.
    • Improved compatibility with CommonJS-based cryptography modules during development and builds.

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.
@ajnart
ajnart requested a review from a team as a code owner July 14, 2026 15:36
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Turbopack configuration

Layer / File(s) Summary
Ignore unexpected export warning
apps/nextjs/next.config.ts
Adds a Turbopack ignoreIssue entry for "unexpected export *" across "**/*", with comments describing the CommonJS node:crypto export scenario.

Possibly related PRs

Suggested reviewers: meierschlumpf

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: suppressing a Turbopack node:crypto export-star warning in Next.js.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Yagni / Over-Engineering ✅ Passed The PR is a minimal config-only workaround: one new ignoreIssue entry and a brief comment, with no new abstractions or dependency churn.
Docs Are Up To Date ✅ Passed PR only changes apps/nextjs/next.config.ts to ignore a Turbopack warning; it doesn't add a widget or integration, so apps/docs updates aren't required.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/turbopack-crypto-warning

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/nextjs/next.config.ts (1)

45-51: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Narrow the suppression path.

path: "**/*" suppresses every "unexpected export *" issue, including future unrelated bundling problems. Use the resolved node:crypto/@homarr/image-proxy origin 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

📥 Commits

Reviewing files that changed from the base of the PR and between 94a247e and 70af7df.

📒 Files selected for processing (1)
  • apps/nextjs/next.config.ts

Comment on lines +45 to +51
{
// 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 *",
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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.json

Repository: 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:


🏁 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:


🌐 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:


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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant