Repository navigation
Cannot resolve @sentry/nextjs on Cloudflare Workers #18843
Description
Activity
Related to: https://sentry.zendesk.com/agent/tickets/172169
- moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3
on Jan 21, 2026 I could not reproduce this yet, for all my testing and deploying on actual cloudflare workers. Then I tried using other package managers like
yarnand it failed to build like the user's suggesting, but for a completely different reason leading back to opentelemetry code.Error: Dynamic require of "util" is not supported at file:///private/var/folders/pp/cjdbvd7s5qgdf3sknws0qc300000gn/T/open-next-tmpuqTrEe/next.config.mjs:11:9 at node_modules/@opentelemetry/instrumentation-http/node_modules/@opentelemetry/core/build/src/platform/node/environment.js (file:///private/var/folders/pp/cjdbvd7s5qgdf3sknws0qc300000gn/T/open-next-tmpuqTrEe/next.config.mjs:20279:18)I went back to trying
pnpmas a package manager gives out the same error but forfsinsteadError: Dynamic require of "fs" is not supported at file:///private/var/folders/pp/cjdbvd7s5qgdf3sknws0qc300000gn/T/open-next-tmpfjLfRt/next.config.mjs:11:9 at node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]._642beec2415f4c4ff5b3cf7d656f1188/node_modules/@sentry/nextjs/build/cjs/config/util.js (file:///private/var/folders/pp/cjdbvd7s5qgdf3sknws0qc300000gn/T/open-next-tmpfjLfRt/next.config.mjs:16154:14)I think it might be something related to wrangler environment in new projects because I didn't get those errors before and it continues to work on one of my old test projects 🤔
The user errors happen at the next build stage rather than Opennext artifact packaging.
EDIT: Setting up a new CF worker app with Next.js works well with all package managers, so this seems like a flake or an incorrect setup. Still no reproduction for the original issue.
Reacted by Tom FischerI get this error while using a monorepo with pnpm.
@Livijn Could you reproduce this in a minimal example repo? This can help us resolve this as we aren't sure what might be causing this.
28 remaining items
- moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3
on Feb 6, 2026 I will take a look at sourcemap uploading with opennext and see what is going on there, thanks for raising this. If I find something we can improve I will create and link a new issue here.
Reacted by FredrikI already did create a new issue for that specifically: #19213
Reacted by Abdelrahman Awad- moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3
on Feb 6, 2026 This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you remove the label
Waiting for: Community, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
Metadata
Metadata
Assignees
Projects
- StatusShow more project fieldsWaiting for: Community
Description
Some users reported errors related to
@sentry/nextjsnot being resolved correctly in Cloudflare Workers runtime.Workaround
@dispalt reported that the following workaround fixes it:
User Reports:
I didn't manage to reproduce this at all, but it could be something with NFT or specific configurations.