-
Notifications
You must be signed in to change notification settings - Fork 504
Migrate to SvelteKit 2.0 #1458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to SvelteKit 2.0 #1458
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Build is breaking - I think related to the Sentry integration / moving to Vite 5 /node_modules/@sentry/node/esm/transports/http.js".
at error (file:///vercel/path0/node_modules/.pnpm/rollup@4.9.0/node_modules/rollup/dist/es/shared/parseAst.js:337:30)
at Module.error (file:///vercel/path0/node_modules/.pnpm/rollup@4.9.0/node_modules/rollup/dist/es/shared/node-entry.js:12753:16)
at Module.traceVariable (file:///vercel/path0/node_modules/.pnpm/rollup@4.9.0/node_modules/rollup/dist/es/shared/node-entry.js:13190:29)
at ModuleScope.findVariable (file:///vercel/path0/node_modules/.pnpm/rollup@4.9.0/node_modules/rollup/dist/es/shared/node-entry.js:11607:39)
at FunctionScope.findVariable (file:///vercel/path0/node_modules/.pnpm/rollup@4.9.0/node_modules/rollup/dist/es/shared/node-entry.js:5911:38)
at FunctionBodyScope.findVariable (file:///vercel/path0/node_modules/.pnpm/rollup@4.9.0/node_modules/rollup/dist/es/shared/node-entry.js:5911:38)
at Identifier.bind (file:///vercel/path0/node_modules/.pnpm/rollup@4.9.0/node_modules/rollup/dist/es/shared/node-entry.js:7193:40)
at NewExpression.bind (file:///vercel/path0/node_modules/.pnpm/rollup@4.9.0/node_modules/rollup/dist/es/shared/node-entry.js:4639:23)
at ReturnStatement.bind (file:///vercel/path0/node_modules/.pnpm/rollup@4.9.0/node_modules/rollup/dist/es/shared/node-entry.js:4639:23)
at BlockStatement.bind (file:///vercel/path0/node_modules/.pnpm/rollup@4.9.0/node_modules/rollup/dist/es/shared/node-entry.js:4635:28)
ELIFECYCLE Command failed with exit code 1.
ERROR: "build:svelte" exited with 1.
ELIFECYCLE Command failed with exit code 1.
Error: Command "pnpm build" exited with 1
will ping @AbhiPrasad as he made the issue on sentry-javascript |
Hey @wesbos I'm currently trying to get the SDK to work with Kit 2.0. To debug, I cloned this repo and checked out your PR. I think I've identified a fix for the problem but I'm not entirely sure because I don't get the exact same error and some other weird stuff is going on. The error I'm getting is pretty similar though to the one from CI. Could you test something for me: "exports": {
"browser": "./esm/index.client.js",
"node": "./cjs/index.server.js"
}, For me, adding these conditional exports resolved the build error.
To expand on this: for some reason hydration seems to break in dev mode for me. For a split second, I can see the SSR html in the browser but then I get an error 500 page (no console output though). However, this still happens, even if I remove all Sentry SDK usage. Not sure if this is a kit bug or has something to do with the env variables I (didn't) set. |
Would love to get this merged. Might dive in an confirm we are gtg here. Would love to get on Node 20. |
Latest version of the SDK should have SvelteKit 2.0 support - it was specifically released with https://github.com/getsentry/sentry-javascript/releases/tag/7.89.0 SDK is also tests with latest Node 20/21, so you should be good to go there! |
@AbhiPrasad it seems like this error is still happening in Sentry/SvelteKit 7.93. I'll try removing the Sentry code and diving in further. |
As you suspected @AbhiPrasad the issue is not with Sentry. Very difficult to get a handle on where the problem actually is though. |
Found it! SearchResults.svelte importing the type Tree without import type. 🥴 |
Ok sorry for the spam, going to re-add the Sentry code. Test more and get this pushed up and merged. |
Very tricky. Looking at your tsconfig I do see In Sveltekit 2.0 the generated tsconfig in |
…ting before merge
need to see if this builds, but seems pretty smooth.