Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/sveltekit
SDK Version
7.54.0
Framework Version
@sveltejs/kit == 1.20.0
Link to Sentry event
No response
SDK Setup
hooks.client.ts...
Sentry.init({dsn: config.sentryDSN,environment: config.env,tracesSampleRate: 1,replaysSessionSampleRate: 0.1,replaysOnErrorSampleRate: 1,integrations: [newSentry.Replay()]});hooks.server.ts
Sentry.init({dsn: config.sentryDSN,environment: config.env,tracesSampleRate: 1});Steps to Reproduce
- manually setup the sveltekit + sentry integration
- verify it's working locally
- install adapter-cloud flare and update svelte.config.ts according to sveltekit documentation -- partial example provided below.
- deploy to cloudflare (can't easily give you a way to reproduce this portion, but let me know if I can additional details
sample svelte.config.js
importadapterfrom'@sveltejs/adapter-cloudflare';import{vitePreprocess}from'@sveltejs/kit/vite';/** @type {import('@sveltejs/kit').Config} */constconfig={// Consult https://kit.svelte.dev/docs/integrations#preprocessors// for more information about preprocessorspreprocess: vitePreprocess(),kit: {adapter: adapter()};exportdefaultconfig;Expected Result
Successful build & deploy from cloudflare pages
Actual Result
16:37:00.142 | > Using @sveltejs/adapter-cloudflare
-- | --
16:37:00.627 | ✘ [ERROR] Could not resolve "$app/stores"
16:37:00.628 | 16:37:00.628 | node_modules/.pnpm/@sentry+sveltekit@7.54.0_@sveltejs+kit@1.20.0_svelte@3.59.1/node_modules/@sentry/sveltekit/esm/client/router.js:3:33:
16:37:00.628 | 3 │ import { page, navigating } from '$app/stores';
16:37:00.628 | ╵ ~~~~~~~~~~~~~
16:37:00.628 | 16:37:00.629 | You can mark the path "$app/stores" as external to exclude it from the bundle, which will remove this error.
16:37:00.629 | 16:37:01.102 | error during build:
16:37:01.103 | Error: Build failed with 1 error:
16:37:01.104 | node_modules/.pnpm/@sentry+sveltekit@7.54.0_@sveltejs+kit@1.20.0_svelte@3.59.1/node_modules/@sentry/sveltekit/esm/client/router.js:3:33: ERROR: Could not resolve "$app/stores"
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/sveltekit
SDK Version
7.54.0
Framework Version
@sveltejs/kit == 1.20.0
Link to Sentry event
No response
SDK Setup
hooks.client.ts...
hooks.server.ts
Steps to Reproduce
sample svelte.config.js
Expected Result
Successful build & deploy from cloudflare pages
Actual Result