-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed as not planned
Closed as not planned
Copy link
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?
Self-hosted/on-premise
Which SDK are you using?
@sentry/sveltekit
SDK Version
^10
Framework Version
sveltejs/kit@^2.37.0 + svelte@^5.38.6
Link to Sentry event
No response
Reproduction Example/SDK Setup
svelte.config.js:
import { execSync } from 'node:child_process'
import adapter from '@sveltejs/adapter-node'
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
const config = {
preprocess: vitePreprocess(),
kit: {
adapter: adapter(),
version: {
name:
execSync('git rev-parse HEAD').toString().trimEnd().substring(0, 7) +
'/' +
process.env.PUBLIC_APP_ENV
},
experimental: {
tracing: {
server: true
},
instrumentation: {
server: true
}
}
}
}
export default config
Steps to Reproduce
- Create svelte kit project
- Put svelte.config.js above
- Run project
Without version, with async version getting or without sentry source map plugin it works fine.
See https://svelte.dev/docs/kit/configuration#version
Expected Result
Version loads and source map plugin works
Actual Result
[Source Maps Plugin] Couldn't load svelte.config.js:
16 | try {
17 | if (!fs.existsSync(configFile)) {
18 | return {};
19 | }
20 | // @ts-expect-error - we explicitly want to import the svelte config here.
21 | const svelteConfigModule = await import(`${url.pathToFileURL(configFile).href}`);
^
ReferenceError: Cannot access 'default' before initialization.
at loadSvelteConfig (/path/to/node_modules/@sentry/sveltekit/build/esm/vite/svelteConfig.js:21:78)
at spawnSync (node:child_process:226:22)
at execSync (node:child_process:275:109)
at /path/to/svelte.config.js:12:9
at requestImportModule (2:1)
Metadata
Metadata
Assignees
Projects
Status
Waiting for: Community