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
Module not found: Can't resolve '@sentry/utils/esm/buildPolyfills' #8180
This also happened to me in an application using Yarn Berry (v3.5.1) and PnP on NextJS. @sentry/nextjs kept erroring in the build with this exact same error, until I set nodeLinker: node-modules in my .yarnrc.
I also tried unplugging @sentry/nextjs as well as next itself, but that didn't seem to do anything. I suspect some dependency of the next build process is the culprit here...
@mayank1513 your repro is failing due to issues unrelated to sentry:
@next/react-dev-overlay:build: src/internal/helpers/launchEditor.ts(217,5): error TS2322: Type 'ParseEntry[]' is not assignable to type 'string[]'.
@next/react-dev-overlay:build: Type 'ParseEntry' is not assignable to type 'string'.
@next/react-dev-overlay:build: Type '{ op: ControlOperator; }' is not assignable to type 'string'.
@next/react-dev-overlay:build: ELIFECYCLE Command failed with exit code 2.
@next/react-dev-overlay:build: ERROR: command finished with error: command (/workspaces/clones/next.js/packages/react-dev-overlay) pnpm run build exited (1)
Attempting to add Sentry to my Next.js project (using App Router and pnpm) using the Sentry Wizard:
npx @sentry/wizard@latest -i nextjs
I get this error:
Update:
For anyone coming here using pnpm and NextJS App Router - install @sentry/utils manually after everything the Sentry Wizard installs and sets up for your project. This fixes it! ✅ Not sure why this isn't installed by the wizard.
I was running into this similar problem, and it turns out in my Webpack configuration (technically the config function that I send through my 11ty Webpack plugin config) I had at one time added ".js" to the resolve.extensions array, and subsequently removed it.
I determined that removing that entry in part caused this issue to occur.
Adding the .js extension back solved the issue.
Here's an abridged section of my plugin's Webpack config object:
I'm fairly certain that if you are using pnpm or yarn berry, you'll still need to manually add @sentry/utils as a directly dependency to your nextjs project. Otherwise you'll get a variant of the original error reported!
As a positive outlook: We aim to fix this reliably with the new major of the SDK! Sorry for the trouble this has caused. We have a bit of tech debt here.
Activity
getsantry commentedon May 20, 2023
Assigning to @getsentry/support for routing, due by Monday, May 22nd at 5:00 pm (sfo). ⏲️
lforst commentedon May 22, 2023
Hey, can you share a small reproduction app where this is happening thank you!
tubbo commentedon May 23, 2023
This also happened to me in an application using Yarn Berry (v3.5.1) and PnP on NextJS.
@sentry/nextjskept erroring in the build with this exact same error, until I setnodeLinker: node-modulesin my.yarnrc.I also tried unplugging
@sentry/nextjsas well asnextitself, but that didn't seem to do anything. I suspect some dependency of thenext buildprocess is the culprit here...Huespal commentedon May 30, 2023
Hello.
Our team is experiencing the same.
Do you have a date when it will be fixed?
Thank you.
39 remaining items
mayank1513 commentedon Sep 14, 2023
https://github.com/vercel/next.js/blob/canary/contributing/examples/run-example-apps.md
lforst commentedon Sep 14, 2023
@mayank1513 your repro is failing due to issues unrelated to sentry:
yashsway commentedon Oct 24, 2023
Attempting to add Sentry to my Next.js project (using App Router and
pnpm) using the Sentry Wizard:I get this error:

Update:
For anyone coming here using
pnpmand NextJS App Router - install@sentry/utilsmanually after everything the Sentry Wizard installs and sets up for your project. This fixes it! ✅ Not sure why this isn't installed by the wizard.geoffdavis92 commentedon Oct 30, 2023
I was running into this similar problem, and it turns out in my Webpack configuration (technically the config function that I send through my 11ty Webpack plugin config) I had at one time added
".js"to theresolve.extensionsarray, and subsequently removed it.I determined that removing that entry in part caused this issue to occur.
Adding the
.jsextension back solved the issue.Here's an abridged section of my plugin's Webpack config object:
For reference, here's my tsconfig:
{ "include": ["./src/js/**/*"], "exclude": ["node_modules"], "compilerOptions": { "target": "ES2015", "moduleResolution": "node", "allowJs": true, "module": "ES6", "lib": ["es2022", "dom", "dom.iterable"], "sourceMap": true, "inlineSources": true, // Set `sourceRoot` to "/" to strip the build path prefix // from generated source code references. // This improves issue grouping in Sentry. "sourceRoot": "/" } }kirbysayshi commentedon Feb 9, 2024
I'm fairly certain that if you are using pnpm or yarn berry, you'll still need to manually add
@sentry/utilsas a directly dependency to your nextjs project. Otherwise you'll get a variant of the original error reported!lforst commentedon Feb 9, 2024
As a positive outlook: We aim to fix this reliably with the new major of the SDK! Sorry for the trouble this has caused. We have a bit of tech debt here.
add sentry/utils per getsentry/sentry-javascript#8180