Is there an existing issue for this?
How do you use Sentry?
Sentry SaaS
Which SDK are you using?
@sentry/sveltekit
SDK Version
10.45.0
I suspect this may also affect 10.44.0, but I confirmed it with 10.45.0.
Framework Version
@sveltejs/kit: 2.55.0
vite: 8.0.1
@sveltejs/adapter-vercel: 6.3.3
Runtime / Deployment Target
Reproduction Example / Repo
Repo: https://github.com/TGilany/couch-potato
PR showing the regression: https://github.com/TGilany/couch-potato/pull/76
Steps to Reproduce
- Have a SvelteKit app with a
vite.config.ts that imports sentrySvelteKit from @sentry/sveltekit
- Upgrade
@sentry/sveltekit to 10.45.0
- Deploy to Vercel
- Build fails while loading
vite.config.ts
Expected Result
If Sentry is not actually enabled for the build, importing the Vite config should not fail.
More generally, @sentry/sveltekit should not cause a Vercel build failure during config evaluation due to transitive telemetry dependencies.
Actual Result
Vercel fails before the app build completes with:
failed to load config from /vercel/path0/vite.config.ts
error during build:
Error: Cannot find package '/vercel/path0/node_modules/@prisma/instrumentation/node_modules/@opentelemetry/instrumentation/index.js' imported from /vercel/path0/node_modules/@prisma/instrumentation/dist/index.mjs
Did you mean to import "@opentelemetry/instrumentation/build/src/index.js"?
at legacyMainResolve (node:internal/modules/esm/resolve:204:26)
at packageResolve (node:internal/modules/esm/resolve:778:12)
at moduleResolve (node:internal/modules/esm/resolve:858:18)
at defaultResolve (node:internal/modules/esm/resolve:990:11)
at #cachedDefaultResolve (node:internal/modules/esm/loader:718:20)
at #resolveAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:735:38)
at ModuleLoader.resolveSync (node:internal/modules/esm/loader:764:52)
at #resolve (node:internal/modules/esm/loader:700:17)
at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:620:35)
at ModuleJob.syncLink (node:internal/modules/esm/module_job:143:33) {
code: 'ERR_MODULE_NOT_FOUND'
}
✖ 'vite build' failed
error: script "build" exited with code 1
Error: Command "bun run build" exited with 1
Investigation
From the installed dependency tree:
@sentry/sveltekit@10.45.0 depends on @sentry/node@10.45.0
@sentry/node@10.45.0 depends on @prisma/instrumentation@7.4.2
@prisma/instrumentation/dist/index.mjs imports @opentelemetry/instrumentation
This means that simply importing @sentry/sveltekit in vite.config.ts is enough to trigger the failing resolution path on Vercel/Node 24, even before application code builds.
Temporary Workaround
I worked around this by lazy-loading @sentry/sveltekit inside defineConfig(async () => ...) only when Sentry env vars are actually present:
export default defineConfig(async () => {
const plugins = [tailwindcss(), sveltekit()];
if (process.env.SENTRY_ORG && process.env.SENTRY_PROJECT) {
const { sentrySvelteKit } = await import('@sentry/sveltekit');
plugins.unshift(
sentrySvelteKit({
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
})
);
}
return { plugins };
});
This avoids the Vercel failure in my app.
Question
Should @sentry/sveltekit be avoiding this eager import path, or is there a known issue with the current @sentry/node -> @prisma/instrumentation -> @opentelemetry/instrumentation chain under Node 24 / Vercel?
Is there an existing issue for this?
How do you use Sentry?
Sentry SaaS
Which SDK are you using?
@sentry/sveltekitSDK Version
10.45.0I suspect this may also affect
10.44.0, but I confirmed it with10.45.0.Framework Version
@sveltejs/kit:2.55.0vite:8.0.1@sveltejs/adapter-vercel:6.3.3Runtime / Deployment Target
Reproduction Example / Repo
Repo:
https://github.com/TGilany/couch-potatoPR showing the regression:
https://github.com/TGilany/couch-potato/pull/76Steps to Reproduce
vite.config.tsthat importssentrySvelteKitfrom@sentry/sveltekit@sentry/sveltekitto10.45.0vite.config.tsExpected Result
If Sentry is not actually enabled for the build, importing the Vite config should not fail.
More generally,
@sentry/sveltekitshould not cause a Vercel build failure during config evaluation due to transitive telemetry dependencies.Actual Result
Vercel fails before the app build completes with:
failed to load config from /vercel/path0/vite.config.ts error during build: Error: Cannot find package '/vercel/path0/node_modules/@prisma/instrumentation/node_modules/@opentelemetry/instrumentation/index.js' imported from /vercel/path0/node_modules/@prisma/instrumentation/dist/index.mjs Did you mean to import "@opentelemetry/instrumentation/build/src/index.js"? at legacyMainResolve (node:internal/modules/esm/resolve:204:26) at packageResolve (node:internal/modules/esm/resolve:778:12) at moduleResolve (node:internal/modules/esm/resolve:858:18) at defaultResolve (node:internal/modules/esm/resolve:990:11) at #cachedDefaultResolve (node:internal/modules/esm/loader:718:20) at #resolveAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:735:38) at ModuleLoader.resolveSync (node:internal/modules/esm/loader:764:52) at #resolve (node:internal/modules/esm/loader:700:17) at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:620:35) at ModuleJob.syncLink (node:internal/modules/esm/module_job:143:33) { code: 'ERR_MODULE_NOT_FOUND' } ✖ 'vite build' failed error: script "build" exited with code 1 Error: Command "bun run build" exited with 1Investigation
From the installed dependency tree:
@sentry/sveltekit@10.45.0depends on@sentry/node@10.45.0@sentry/node@10.45.0depends on@prisma/instrumentation@7.4.2@prisma/instrumentation/dist/index.mjsimports@opentelemetry/instrumentationThis means that simply importing
@sentry/sveltekitinvite.config.tsis enough to trigger the failing resolution path on Vercel/Node 24, even before application code builds.Temporary Workaround
I worked around this by lazy-loading
@sentry/sveltekitinsidedefineConfig(async () => ...)only when Sentry env vars are actually present:This avoids the Vercel failure in my app.
Question
Should
@sentry/sveltekitbe avoiding this eager import path, or is there a known issue with the current@sentry/node -> @prisma/instrumentation -> @opentelemetry/instrumentationchain under Node 24 / Vercel?