Skip to content

Conversation

chargome
Copy link
Member

@chargome chargome commented Sep 29, 2025

We don't know yet why but this config code seems to be evaluated once at runtime for some users when using turbopack. The chalk import breaks with Failed to load external module @sentry/nextjs: Error [ERR_REQUIRE_ESM].
Just getting rid of this import for now to not break apps.

We're still investigating together with Vercel why this this code gets pulled in.

closes #17691


Note

Removes the chalk import and replaces the colored debug message with a plain "[@sentry/nextjs]"-prefixed string in Turbopack rule handling.

  • Next.js Turbopack config:
    • Remove chalk import from packages/nextjs/src/config/turbopack/constructTurbopackConfig.ts.
    • Replace chalk-based colored debug.log with a plain "[@sentry/nextjs] - ..." message in safelyAddTurbopackRule.

Written by Cursor Bugbot for commit 9026ac4. This will update automatically on new commits. Configure here.

@chargome chargome self-assigned this Sep 29, 2025
@chargome chargome merged commit 5ce4435 into develop Sep 29, 2025
54 of 57 checks passed
@chargome chargome deleted the cg-next-chalk-runtime-error branch September 29, 2025 09:49
andreiborza pushed a commit to thedanchez/sentry-javascript that referenced this pull request Oct 15, 2025
We don't know yet why but this config code seems to be evaluated once at
runtime for some users when using turbopack. The chalk import breaks
with `Failed to load external module @sentry/nextjs: Error
[ERR_REQUIRE_ESM]`.
Just getting rid of this import for now to not break apps.

We're still investigating together with Vercel why this this code gets
pulled in.

closes getsentry#17691
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.

Failed to load external module @sentry/nextjs: Error [ERR_REQUIRE_ESM]

3 participants