-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
process is not defined in dev mode - @sentry/sveltekit #8377
Comments
Hi @dann2g thanks for writing in! On first glance, this looks like something went wrong during installation. Node code should not end up in your browser JS bundles. Just as a sanity check, I added the SDK to a fresh SvelteKit app and running dev mode works fine for me. |
@Lms24 You're right. We found the culprit, it was due to the
Not a Sentry issue so this can be closed. Thank you for your help. |
No worries, glad you found it :) |
In my SvelteKit project upgrading to Vite v5 seems to produce this issue without addition plugins. |
@geoextra any chance you can provide a minimal reproduction that demonstrates this bug? Haven't looked into SvelteKit + Vite 5 yet so I'm happy to reopen this if we can reproduce it. |
This problem might be tracked in #9624 as well. |
Yup, we're aware of this issue. Just don't have time to look at it at the moment. Yeah, maybe we just wait for official Sveltekit<>Vite 5 support first and then investigate. I already tested Vite 5 with Astro and our Astro SDK (which also uses our Vite plugin) and it seems to work well. |
I have same issue, and i used the wizard installation. How can i resolve it |
|
Hi @internpoon can you provide a minimal reproducible example of your issue? Node code shouldn't end up in your browser bundle and checking an env variable should generally work in Node land. Are you using Vite 5? If yes: we're having some troubles with Vite 5 and Sveltekit. Maybe I have time to look at this next week. |
Nope, I'm using Vite 4.5.1 |
To debug this: if you remove this file, do you still get the error? I have an idea what could be causing this issue (might be related to #9629) but I'm still surprised that this would end up in a browser bundle. |
yea, as long as I remove this line |
I checked and we access
|
Unfortunately, the |
However, this seems to be fixed when migrating to SvelteKit v2. |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/browser
SDK Version
7.56.0
Framework Version
1.5.0
Link to Sentry event
No response
SDK Setup
N/A
Steps to Reproduce
Install @sentry/sveltekit as a node dependency
Run start SvelteKit in dev mode with
npm run dev
Error in console:
No other code required
Expected Result
SvelteKit dev mode works normally (no errors)
Actual Result
JavaScript on page is broken due to the following error:
For some reason the @sentry/sveltekit package is getting bundled into the client side code and in utils.js (from the above error) is trying to access
process.env.NODE_DEBUG
.This doesn't happen in the production built version.
The text was updated successfully, but these errors were encountered: