Skip to content

@sentry/sveltekit throws JS parsing error when added to vite.config.js #12032

Closed as not planned

Description

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/svelte

SDK Version

8.0.0 but also happens when I downgrade to 7.114.0.

Framework Version

Sveltekit 2.0.0

Link to Sentry event

No response

SDK Setup

import { sentrySvelteKit } from '@sentry/sveltekit';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vitest/config';

export default defineConfig({
  plugins: [
    sentrySvelteKit({
      sourceMapsUploadOptions: {
        org: 'cnyric',
        project: 'supplies-frontend',
      },
    }),
    sveltekit(),
  ],
  test: {
    include: ['src/**/*.{test,spec}.{js,ts}'],
  },
});

Steps to Reproduce

I followed the directions here: https://docs.sentry.io/platforms/javascript/guides/sveltekit/#compatibility. Then I started my app in dev mode and it instantly crashed.

Expected Result

For my application to not crash. If I comment out the sentrySvelteKit block in the vite.config.js everything works fine.

Actual Result

SyntaxError: Unexpected token, expected "}" (17:42)
    at constructor (/home/[email protected]/dev/supplies_project/supplies_redux/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:351:19)
    at V8IntrinsicMixin.raise (/home/[email protected]/dev/supplies_project/supplies_redux/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:3281:19)
    at V8IntrinsicMixin.unexpected (/home/[email protected]/dev/supplies_project/supplies_redux/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:3301:16)
    at V8IntrinsicMixin.expect (/home/[email protected]/dev/supplies_project/supplies_redux/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:3605:28)
    at V8IntrinsicMixin.jsxParseExpressionContainer (/home/[email protected]/dev/supplies_project/supplies_redux/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:6702:10)
    at V8IntrinsicMixin.jsxParseElementAt (/home/[email protected]/dev/supplies_project/supplies_redux/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:6776:36)
    at V8IntrinsicMixin.jsxParseElement (/home/[email protected]/dev/supplies_project/supplies_redux/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:6814:17)
    at V8IntrinsicMixin.parseExprAtom (/home/[email protected]/dev/supplies_project/supplies_redux/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:6824:19)
    at V8IntrinsicMixin.parseExprAtom (/home/[email protected]/dev/supplies_project/supplies_redux/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:10111:45)
    at V8IntrinsicMixin.parseExprSubscripts (/home/[email protected]/dev/supplies_project/supplies_redux/node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:10607:23

Activity

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

Metadata

Assignees

No one assigned

    Type

    Projects

    • Status

      Waiting for: Community

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions