sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

Build Error @sentry/svelte

Open tarasowski opened this issue 3 years ago • 2 comments

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

  1. Trying to run npm run build and 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

tarasowski avatar Sep 19 '22 11:09 tarasowski

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 avatar Sep 19 '22 11:09 AbhiPrasad

@AbhiPrasad sure, just added answers to your question: I'm using vite 2.8.6 Svelte (not Sveltekit) No code transpiling

tarasowski avatar Sep 19 '22 11:09 tarasowski

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?

Lms24 avatar Sep 29 '22 09:09 Lms24

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/

tarasowski avatar Sep 29 '22 15:09 tarasowski

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?

Lms24 avatar Sep 29 '22 16:09 Lms24

Maybe this applies here? https://github.com/getsentry/sentry-javascript/issues/4473#issuecomment-1026853256

AbhiPrasad avatar Oct 06 '22 09:10 AbhiPrasad