Open
Description
openedon Jun 5, 2023
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
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: [new Sentry.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
import adapter from '@sveltejs/adapter-cloudflare';
import { vitePreprocess } from '@sveltejs/kit/vite';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
// for more information about preprocessors
preprocess: vitePreprocess(),
kit: {
adapter: adapter()
};
export default config;
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/@[email protected]_@[email protected][email protected]/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/@[email protected]_@[email protected][email protected]/node_modules/@sentry/sveltekit/esm/client/router.js:3:33: ERROR: Could not resolve "$app/stores"
Metadata
Assignees
Type
Projects
Status
No status
Status
No status
Status
Waiting for: Product Owner
Activity