Closed
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?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/sveltekit
SDK Version
7.53.1
Framework Version
1.18.0
Link to Sentry event
SDK Setup
Sentry.init({
dsn: config.SENTRY,
tracesSampleRate: 0.05,
environment: 'development',
release: 'c52cb50081964beca7ba61bcd8c113d7',
})
Steps to Reproduce
- I ran
npx @sentry/wizard@latest -i sveltekit
to automatically add Sentry to my SvelteKit Application - I manually put
build: { sourcemaps: true }
in my vite.config.js, because I want sourcemaps for the server - I built my app (
vite build
), started it (node ./build
) and triggered an error locally - I noticed that Sentry stopped showing any code at all in the traces:
- I dug as deep as I could and noticed that the relative paths in the sourcemaps are slightly wrong. They go one level too far up. For example, it would show
../../../../src/routes/+page.svelte
, but relative tobuild/server/chunks
, this is outside of my project folder. So I checked where these paths get set, and ended up creating this bug report in the SvelteKit repo:adapter-node
breaks paths to sourcemap sources by copying files during build sveltejs/kit#10040 - I worked around the bug locally, but I also noticed that the directories of the files are now omitted (instead it prepends
app://
), showing only the filename. In a typical SvelteKit app, many many files are called+page
or+layout
, so this is less than ideal. :D
Expected Result
The full path to the file should be shown.
Actual Result
Previously, when I didn't use sourcemaps, it showed the whole filepath:
