You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Failed to load external module @sentry/nextjs: Error [ERR_REQUIRE_ESM] #17691
Failed to prepare server Error: An error occurred while loading the instrumentation hook
at ignore-listed frames {
[cause]: Error: Failed to load external module @sentry/nextjs: Error [ERR_REQUIRE_ESM]: require() of ES Module /var/task/node_modules/chalk/source/index.js from /var/task/node_modules/@sentry/nextjs/build/cjs/config/turbopack/constructTurbopackConfig.js not supported.
Instead change the require of index.js in /var/task/node_modules/@sentry/nextjs/build/cjs/config/turbopack/constructTurbopackConfig.js to a dynamic import() which is available in all CommonJS modules.
Hey @typeofweb thanks for reaching out! Looks like parts of the build-time code is executed during runtime which should not be the case. I'll try to ship a fix so we don't pull in chalk for now as this causes the error – also contacted Vercel on the underlying issue, we're investigating why this code gets pulled in.
Do we have an estimated timeline for resolving this issue? I'm currently trying to upgrade chalk to its latest version in my project, but I'm blocked due to this problem.
Hi @chargome, any update on this issue would be greatly appreciated. This is a blocker for what I'm working on and I will be going on vacation next week so would like to provide some context to my team member before I leave.
Hey @Tthulasika we're still investigating the underlying issue, I added a fix now that removes the chalk usage – hopefully this will unblock you guys for now. Will make sure to release it this week.
Activity
linear commentedon Sep 18, 2025
JS-955 Failed to load external module @sentry/nextjs: Error [ERR_REQUIRE_ESM]
chargome commentedon Sep 18, 2025
Hey @typeofweb thanks for reaching out! Looks like parts of the build-time code is executed during runtime which should not be the case. I'll try to ship a fix so we don't pull in
chalkfor now as this causes the error – also contacted Vercel on the underlying issue, we're investigating why this code gets pulled in.chargome commentedon Sep 22, 2025
@typeofweb could you actually provide a reproduction for this? I don't seem to run into this error.
jmfmeireles commentedon Sep 26, 2025
Hi everyone,
Do we have an estimated timeline for resolving this issue? I'm currently trying to upgrade chalk to its latest version in my project, but I'm blocked due to this problem.
Thanks in advance for any updates!
9 remaining items
Tthulasika commentedon Oct 14, 2025
@chargome we are using webpack to run the app
fix(nextjs): Don't use chalk in turbopack config file (getsentry#17806)
Tthulasika commentedon Oct 22, 2025
Hi @chargome, any update on this issue would be greatly appreciated. This is a blocker for what I'm working on and I will be going on vacation next week so would like to provide some context to my team member before I leave.
Thanks in advance!
chargome commentedon Oct 23, 2025
Hey @Tthulasika we're still investigating the underlying issue, I added a fix now that removes the chalk usage – hopefully this will unblock you guys for now. Will make sure to release it this week.
fix(nextjs): Remove usage of chalk to avoid runtime errors (#18010)