Build Error @sentry/svelte
Is there an existing issue for this?
- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- [X] I have reviewed the documentation https://docs.sentry.io/
- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/node
SDK Version
7.13.0
Framework Version
Svelte 3.46.4
Link to Sentry event
No response
Steps to Reproduce
- Trying to run
npm run buildand getting this error:
Could not resolve './{}.js' from node_modules/@sentry/utils/esm/index.js
error during build:
Error: Could not resolve './{}.js' from node_modules/@sentry/utils/esm/index.js
- I'm using vite 2.8.6
- Svelte (not Sveltekit)
- No code transpiling
Expected Result
Successful build
Actual Result
Build fails
Hey, thanks for writing in! Could you supply a minimal reproduction of what you were trying to run npm run build on? This would help us debug why this error is occuring.
Are you using webpack/rollup or another bundler? Do you do any transpiling of code? Are you using SvelteKit alongside Svelte?
@AbhiPrasad sure, just added answers to your question: I'm using vite 2.8.6 Svelte (not Sveltekit) No code transpiling
Hi @tarasowski
do you still encounter this problem? If yes, can you show us how you're initializing the SDK? What are you importing from the SDK? Are you using component tracking?
I'm guessing you've selected @sentry/node as the package you're using because at the time of writing this issue, the Svelte SDK was not in the issue template list, right? Or in other words, are you using other/additional Sentry SDKs in your projects? Are you using @sentry/tracing?
I still have this error. I have removed it from my app right now. I was following this instruction here: https://docs.sentry.io/platforms/javascript/guides/svelte/
That's unfortunate as I'd love to get to the bottom of this (our Svelte SDK is still quite new so there might be some cases we haven't discovered yet that may cause this). Let me know in case you install the SDK again or if you have time to provide a minimal reproduction.
Just to confirm: Were you using component tracking? More specifically, did you use our Sentry.componentTrackingPreprocessor?
Maybe this applies here? https://github.com/getsentry/sentry-javascript/issues/4473#issuecomment-1026853256