Skip to content

[@sentry/nuxt] Nuxt fails to build when using --preset cloudflare-pages #16742

Closed
@blackburn32

Description

@blackburn32

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nuxt

SDK Version

9.32.0

Framework Version

Nuxt 3.17.5

Link to Sentry event

No response

Reproduction Example/SDK Setup

Here's an example repo: https://github.com/blackburn32/sentry-test

All I did was:

  1. Create new nuxt project
  2. Use sentry setup wizard
  3. Switch build preset to cloudflare-pages

I receive this error when building my Nuxt app using the cloudflare-pages preset:

[nitro 2:48:17 PM] ERROR Error: Cannot resolve "@opentelemetry/resources/build/src/index.js/build/src/index.js/build/src/index.js/build/src/index.js" from "C:\\Users\\...\\WebstormProjects\\sentry-test\\node_modules\\@sentry\\node\\build\\esm\\sdk\\initOtel.js" and externals are not allowed!

Happens during / after building the server.

This build worked fine on an earlier version, I bumped into this while trying to upgrade my sentry version from 9.15.0 to 9.32.0.

Steps to Reproduce

Install dependencies and run:
npm run build

Observe the error

Expected Result

Building completes successfully

Actual Result

Build fails with the following error:

[2:48:17PM] ERROR Cannot resolve "@opentelemetry/resources/build/src/index.js/build/src/index.js/build/src/index.js/build/src/index.js" from "C:\\Users\\...\\sentry-test\\node_modules\\@sentry\\node\\build\\esm\\sdk\\initOtel.js" and externals are not allowed!

at Object.resolveId (/C:/Users/.../sentry-test/node_modules/nitropack/dist/rollup/index.mjs:2010:17)
at async PluginDriver.hookFirstAndGetPlugin (/C:/Users/.../sentry-test/node_modules/rollup/dist/es/shared/node-entry.js:22166:28)
at async resolveId (/C:/Users/king_/sentry-test/node_modules/rollup/dist/es/shared/node-entry.js:20647:26)
at async ModuleLoader.resolveId (/C:/Users/king_/sentry-test/node_modules/rollup/dist/es/shared/node-entry.js:21083:15)
at async Object.resolveId (/C:/Users/.../sentry-test/node_modules/@rollup/plugin-commonjs/dist/es/index.js:604:10)
at async PluginDriver.hookFirstAndGetPlugin (/C:/Users/.../sentry-test/node_modules/rollup/dist/es/shared/node-entry.js:22166:28)
at async resolveId (/C:/Users/.../sentry-test/node_modules/rollup/dist/es/shared/node-entry.js:20647:26)
at async ModuleLoader.resolveId (/C:/Users/.../sentry-test/node_modules/rollup/dist/es/shared/node-entry.js:21083:15)
at async PluginDriver.hookFirstAndGetPlugin (/C:/Users/.../sentry-test/node_modules/rollup/dist/es/shared/node-entry.js:22166:28)
at async resolveId (/C:/Users/.../sentry-test/node_modules/rollup/dist/es/shared/node-entry.js:20647:26)
at async ModuleLoader.resolveId (/C:/Users/.../sentry-test/node_modules/rollup/dist/es/shared/node-entry.js:21083:15)
at async Object.resolveId (/C:/Users/.../sentry-test/node_modules/@rollup/plugin-commonjs/dist/es/index.js:604:10)
at async PluginDriver.hookFirstAndGetPlugin (/C:/Users/.../sentry-test/node_modules/rollup/dist/es/shared/node-entry.js:22166:28)
at async resolveId (/C:/Users/.../sentry-test/node_modules/rollup/dist/es/shared/node-entry.js:20647:26)
at async ModuleLoader.resolveId (/C:/Users/.../sentry-test/node_modules/rollup/dist/es/shared/node-entry.js:21083:15)
at async /C:/Users/.../sentry-test/node_modules/rollup/dist/es/shared/node-entry.js:21383:50`

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Waiting for: Product Owner

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions