Repository navigation
Closed
Labels
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/sveltekit
SDK Version
9.0.0
Framework Version
Sveltekit 2.17.1
Link to Sentry event
No response
Reproduction Example/SDK Setup
import { sentrySvelteKit } from '@sentry/sveltekit';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vitest/config';
export default defineConfig({
plugins: [
sentrySvelteKit({
sourceMapsUploadOptions: {
org: '****',
project: '****',
telemetry: false
}
}),
sveltekit()
],
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
},
build: {
rollupOptions: {
output: {
manualChunks: (id) => {
if (id.includes('layerchart')) return 'layerchart';
if (id.includes('tiptap')) return '@tiptap/core';
}
}
}
}
});
Steps to Reproduce
The upgrade to v9 broke our build. We had to revert backt o v8.
Expected Result
It to just build like it did with v8.
Actual Result
failed to load config from backend/vite.config.ts
error during build:
Error [ERR_REQUIRE_CYCLE_MODULE]: Cannot require() ES Module backend/node_modules/.pnpm/vite@6.1.0_@types+node@22.13.1_jiti@1.21.7_yaml@2.7.0/node_modules/vite/dist/node/index.js in a cycle. (from backend/node_modules/.pnpm/@sentry+sveltekit@9.0.0_@opentelemetry+api@1.9.0_@opentelemetry+context-async-hooks@1.3_eade410b93e85394cc20b647e788e9c4/node_modules/@sentry/sveltekit/build/cjs/vite/sourceMaps.js)
at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:352:15)
at loadESMFromCJS (node:internal/modules/cjs/loader:1554:24)
at Module._compile (node:internal/modules/cjs/loader:1705:5)
at Object..js (node:internal/modules/cjs/loader:1888:10)
at Module.load (node:internal/modules/cjs/loader:1458:32)
at Function._load (node:internal/modules/cjs/loader:1275:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:234:24)
at Module.require (node:internal/modules/cjs/loader:1480:12)
at require (node:internal/modules/helpers:135:16)
Reacted by Ben Ayles, Giacomo Randazzo and Alex Bjørlig
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsNo status
Activity
andreiborza commentedon Feb 11, 2025
Hi @tcurdt, thank you for writing in.
I tried to reproduce this with a fresh sveltekit starter project with your config (although I noticed
sveltekit()is missing in your plugins array) but didn't run into this issue.Could you please provide a reproduction repo?
tcurdt commentedon Feb 11, 2025
I removed a comment and by mistake also removed the
sveltekit()plugin.Fixed that in the ticket. Sorry about that.
Hm. I'll try.
Could you share the project files of your starter project? Just so we are using off the same project?
andreiborza commentedon Feb 11, 2025
@tcurdt sure, here's my repo: https://github.com/andreiborza/15363-sveltekit
jamesbirtles commentedon Feb 11, 2025
I am also running into this issue. I tried cloning your repo @andreiborza and get the same problem:
Node version v22.13.1 if it helps
2 remaining items
tcurdt commentedon Feb 11, 2025
I can actually reproduce it with your repo, @andreiborza
No changes.
tcurdt commentedon Feb 11, 2025
I still need to try that on our main repo - but it fixes the test repo.
Good find. But also scary sneaky.
Lms24 commentedon Feb 11, 2025
This error appears with Node 22.12.0 and onwards, and most probably is related to "require ESM". We'll look into it.
In the meantime, to unblock yourselves, you can use Node 22.11.0 or below or version 8 of the SDK.
UPDATE: This is likely related to #14886 where we introduced a possible require cycle by importing the vite config within our plugin. I will attempt to confirm this and keep you all posted once we know more.
Lms24 commentedon Feb 11, 2025
I could confirm that our import of
viteduringsentrySvelteKitVite plugin creation causes this cyclic import. While we would only once import this (and thus not cause an actual infinite cycle), Node can't know this and fails.I tested this a bit and for now, it seems like I can use a dynamic
await import(vite')instead. Opened #15371 and once CI is happy with this change I'll merge it. Sorry for the troubles everyone! We'll likely cut a new release in the next days to get this fix out.tcurdt commentedon Feb 11, 2025
Thanks for the quick help.
Lms24 commentedon Feb 17, 2025
#15371 was merged and released with 9.1.0. Closing this issue. Please let me know if this issue persists (I'm aware of #15414 btw but it's not the same problem)