Skip to content

import.meta.env.VITE_SENTRY_DSN undefined in instrument.server.mjs #235

@MHeinonen

Description

@MHeinonen

Which project does this relate to?

Create Tanstack App

Describe the bug

The following error occurs on startup when including Sentry as an addon.

TypeError: Cannot read properties of undefined (reading 'VITE_SENTRY_DSN')
    at file:///Users/marcusheinonen/code/web/sentry-bug-example/instrument.server.mjs:3:24
    at ModuleJob.run (node:internal/modules/esm/module_job:327:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:663:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:94:9)

I believe this line needs to be updated to use process.env.VITE_SENTRY_DSN instead.

Your Example Website or App

https://github.com/MHeinonen/tsstart-sentry-bug

Steps to Reproduce the Bug or Issue

  1. Run create @tanstack/start
  2. Include sentry addon
  3. Run npm run dev

Expected behavior

Expected behavior is for VITE_SENTRY_DSN to be defined.

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Browser: NA
  • Version: NA

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions