Skip to content

process is not defined in dev mode - @sentry/sveltekit #8377

Description

@dann2g

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:

ReferenceError: process is not defined
    at <stdin> (util.js?v=25e5feed:86:5)
    at __require (util.js?v=25e5feed:3:50)
    at util.js?v=25e5feed:572:16

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:

ReferenceError: process is not defined
    at <stdin> (util.js?v=25e5feed:86:5)
    at __require (util.js?v=25e5feed:3:50)
    at util.js?v=25e5feed:572:16

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions