Skip to content

Commit 3ebf6f6

Browse files
authored
Merge pull request #23 from getsentry/sig/sveltekit-2-v8
feat: Update SvelteKit 2 to v8.0.0-beta.3
2 parents 7e0e0ec + 3a2deb4 commit 3ebf6f6

18 files changed

+947
-1026
lines changed

apps/sveltekit-2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"format": "prettier --write ."
1212
},
1313
"dependencies": {
14-
"@sentry/sveltekit": "7.110.1"
14+
"@sentry/sveltekit": "8.9.2"
1515
},
1616
"devDependencies": {
1717
"@sveltejs/adapter-auto": "^3.0.0",

apps/sveltekit-2/src/hooks.client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as Sentry from '@sentry/sveltekit';
33

44
Sentry.init({
55
environment: 'qa', // dynamic sampling bias to keep transactions
6-
dsn: env.SENTRY_DSN,
6+
dsn: env.PUBLIC_SENTRY_DSN,
77
includeLocalVariables: true,
88
tunnel: `http://localhost:3031/`, // proxy server
99
tracesSampleRate: 1

apps/sveltekit-2/src/hooks.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as Sentry from '@sentry/sveltekit';
33

44
Sentry.init({
55
environment: 'qa', // dynamic sampling bias to keep transactions
6-
dsn: env.SENTRY_DSN,
6+
dsn: env.PUBLIC_SENTRY_DSN,
77
includeLocalVariables: true,
88
tunnel: `http://localhost:3031/`, // proxy server
99
tracesSampleRate: 1

payload-files/sveltekit-2/_api_test-error--event.json

Lines changed: 71 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"event_id": "[[ID1]]",
55
"sdk": {
66
"name": "sentry.javascript.sveltekit",
7-
"version": "7.110.1"
7+
"version": "8.0.0-beta.3"
88
},
99
"sent_at": "[[ISODateString]]",
1010
"trace": {
@@ -68,35 +68,41 @@
6868
"version": "v20.12.1"
6969
},
7070
"trace": {
71-
"data": {
72-
"sentry.op": "http.server",
73-
"sentry.origin": "auto.http.sveltekit",
74-
"sentry.sample_rate": 1
75-
},
76-
"op": "http.server",
77-
"origin": "auto.http.sveltekit",
7871
"parent_span_id": "[[ID3]]",
7972
"span_id": "[[ID4]]",
80-
"status": "ok",
8173
"trace_id": "[[ID2]]"
8274
}
8375
},
76+
"debug_meta": {
77+
"images": [
78+
{
79+
"code_file": "app:///index.js",
80+
"debug_id": "[[ID5]]",
81+
"type": "sourcemap"
82+
},
83+
{
84+
"code_file": "app:///_server.ts.js",
85+
"debug_id": "[[ID6]]",
86+
"type": "sourcemap"
87+
}
88+
]
89+
},
8490
"environment": "qa",
8591
"event_id": "[[ID1]]",
8692
"exception": {
8793
"values": [
8894
{
8995
"mechanism": {
90-
"handled": false,
91-
"type": "sveltekit"
96+
"handled": true,
97+
"type": "generic"
9298
},
9399
"stacktrace": {
94100
"frames": [
95101
{
96102
"colno": 5,
97103
"context_line": "\t\t\t\tawait server.respond(request, {",
98104
"filename": "[[FILENAME1]]",
99-
"function": "<anonymous>",
105+
"function": "?",
100106
"in_app": false,
101107
"lineno": 190,
102108
"post_context": [
@@ -121,7 +127,7 @@
121127
{
122128
"colno": 22,
123129
"context_line": " const response = await options2.hooks.handle({",
124-
"filename": "[[FILENAME2]]",
130+
"filename": "[[FILENAME1]]",
125131
"function": "respond",
126132
"in_app": true,
127133
"lineno": "[[highNumber]]",
@@ -147,36 +153,36 @@
147153
{
148154
"colno": 27,
149155
"context_line": " const resolveResult = await core.startSpan(",
150-
"filename": "[[FILENAME3]]",
156+
"filename": "[[FILENAME2]]",
151157
"function": "instrumentHandle",
152158
"in_app": false,
153-
"lineno": 133,
159+
"lineno": 154,
154160
"post_context": [
155161
" {",
156162
" op: 'http.server',",
157163
" attributes: {",
158164
" [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.sveltekit',",
159-
" },",
160-
" name: `${event.request.method} ${_optionalChain([event, 'access', _3 => _3.route, 'optionalAccess', _4 => _4.id]) || event.url.pathname}`,",
161-
" status: 'ok',"
165+
" [core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: _optionalChain([event, 'access', _5 => _5.route, 'optionalAccess', _6 => _6.id]) ? 'route' : 'url',",
166+
" 'http.method': event.request.method,",
167+
" },"
162168
],
163169
"pre_context": [
164-
" return resolve(event);",
170+
" if (core.getIsolationScope() !== core.getDefaultIsolationScope()) {",
171+
" core.getIsolationScope().setTransactionName(routeName);",
172+
" } else {",
173+
" debugBuild.DEBUG_BUILD && utils$1.logger.warn('Isolation scope is default isolation scope - skipping setting transactionName');",
165174
" }",
166175
"",
167-
" const { dynamicSamplingContext, traceparentData, propagationContext } = utils.getTracePropagationData(event);",
168-
" core.getCurrentScope().setPropagationContext(propagationContext);",
169-
"",
170176
" try {"
171177
]
172178
},
173179
{
174180
"colno": 21,
175181
"context_line": " const res = await resolve(event, {",
176-
"filename": "[[FILENAME3]]",
177-
"function": "<anonymous>",
182+
"filename": "[[FILENAME2]]",
183+
"function": "?",
178184
"in_app": false,
179-
"lineno": 148,
185+
"lineno": 165,
180186
"post_context": [
181187
" transformPageChunk: addSentryCodeToPage(options),",
182188
" });",
@@ -187,26 +193,19 @@
187193
" },"
188194
],
189195
"pre_context": [
190-
" ...traceparentData,",
191-
" metadata: {",
192-
" source: _optionalChain([event, 'access', _5 => _5.route, 'optionalAccess', _6 => _6.id]) ? 'route' : 'url',",
193-
" dynamicSamplingContext: traceparentData && !dynamicSamplingContext ? {} : dynamicSamplingContext,",
196+
" [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.sveltekit',",
197+
" [core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: _optionalChain([event, 'access', _5 => _5.route, 'optionalAccess', _6 => _6.id]) ? 'route' : 'url',",
198+
" 'http.method': event.request.method,",
194199
" },",
200+
" name: routeName,",
195201
" },",
196202
" async (span) => {"
197203
]
198204
},
199-
{
200-
"colno": 5,
201-
"filename": "[[FILENAME4]]",
202-
"function": "process.processTicksAndRejections",
203-
"in_app": false,
204-
"lineno": 95
205-
},
206205
{
207206
"colno": 28,
208207
"context_line": " response = await render_endpoint(event2, await route.endpoint(), state);",
209-
"filename": "[[FILENAME2]]",
208+
"filename": "[[FILENAME1]]",
210209
"function": "resolve2",
211210
"in_app": true,
212211
"lineno": "[[highNumber]]",
@@ -232,10 +231,10 @@
232231
{
233232
"colno": 26,
234233
"context_line": " let response = await handler(",
235-
"filename": "[[FILENAME2]]",
234+
"filename": "[[FILENAME1]]",
236235
"function": "render_endpoint",
237236
"in_app": true,
238-
"lineno": 264,
237+
"lineno": 272,
239238
"post_context": [
240239
" /** @type {import('@sveltejs/kit').RequestEvent<Record<string, any>>} */",
241240
" event",
@@ -256,37 +255,41 @@
256255
]
257256
},
258257
{
259-
"colno": 30,
258+
"colno": 47,
260259
"context_line": " const exceptionId = Sentry.captureException(new Error(\"This is an error\"));",
261-
"filename": "[[FILENAME5]]",
260+
"filename": "[[FILENAME3]]",
262261
"function": "GET",
263262
"in_app": true,
264-
"lineno": 4,
263+
"lineno": 12,
265264
"post_context": [
266265
" await Sentry.flush(2e3);",
267266
" return Response.json({ exceptionId });",
268267
"};",
269268
"export {",
270269
" GET",
271270
"};",
272-
"//# sourceMappingURL=_server.ts.js.map"
271+
""
273272
],
274273
"pre_context": [
275-
"import * as Sentry from \"@sentry/nextjs\";",
276-
"import \"../../../../chunks/sentry-release-injection-file.js\";",
274+
" n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = \"03633952-9898-4aff-9421-a50c37193daa\", e._sentryDebugIdIdenti {snip}",
275+
" } catch (e2) {",
276+
" }",
277+
"}();",
278+
"import * as Sentry from \"@sentry/sveltekit\";",
279+
"import \"../../../../chunks/_sentry-release-injection-file.js\";",
277280
"const GET = async () => {"
278281
]
279282
}
280283
]
281284
},
282-
"type": "TypeError",
283-
"value": "Sentry.captureException is not a function"
285+
"type": "Error",
286+
"value": "This is an error"
284287
}
285288
]
286289
},
287290
"modules": {},
288291
"platform": "node",
289-
"release": "016d073b9f5b47ef8e2d2cff020115bb",
292+
"release": "6ba2507ba4f94699b609ae42c22ec685",
290293
"sdk": {
291294
"integrations": [
292295
"InboundFilters",
@@ -295,37 +298,45 @@
295298
"RequestData",
296299
"Console",
297300
"Http",
298-
"Undici",
301+
"NodeFetch",
299302
"OnUncaughtException",
300303
"OnUnhandledRejection",
301304
"ContextLines",
302-
"LocalVariables",
305+
"LocalVariablesAsync",
303306
"Context",
304307
"Modules",
308+
"Express",
309+
"Fastify",
310+
"Graphql",
311+
"Mongo",
312+
"Mongoose",
313+
"Mysql",
314+
"Mysql2",
315+
"Postgres",
316+
"Nest",
317+
"Hapi",
318+
"Koa",
319+
"Connect",
305320
"RewriteFrames"
306321
],
307322
"name": "sentry.javascript.sveltekit",
308323
"packages": [
309324
{
310325
"name": "npm:@sentry/sveltekit",
311-
"version": "7.110.1"
326+
"version": "8.0.0-beta.3"
312327
},
313328
{
314329
"name": "npm:@sentry/node",
315-
"version": "7.110.1"
330+
"version": "8.0.0-beta.3"
316331
}
317332
],
318-
"version": "7.110.1"
333+
"version": "8.0.0-beta.3"
319334
},
320335
"server_name": "D9M3PY4LQ7.local",
321336
"tags": {
322-
"bundler": "vite",
323-
"finalize-release": true,
324-
"include": "multiple-entries",
325-
"node": "v20.12.1",
326-
"runtime": "node",
327-
"transaction": "GET /api/test-error"
337+
"runtime": "node"
328338
},
329-
"timestamp": "[[timestamp]]"
339+
"timestamp": "[[timestamp]]",
340+
"transaction": "GET /api/test-error"
330341
}
331342
]

0 commit comments

Comments
 (0)