Skip to content

@sentry/feedback >= 11.13 ships *.css.js files that break builds using @vanilla-extract/vite-plugin ("Invalid exports") #26839

Done

Description

@paulo-raca

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

11.17.0 (first affected version: 11.13.0; 11.12.0 is fine)

Framework Version

vite 8.3.8, @vanilla-extract/vite-plugin 5.2.6 (also seen through @sentry/react in an Astro build)

Reproduction Example/SDK Setup

Minimal project, four files (npm install && npm run build):

package.json

{
  "name": "sentry-vanilla-extract-repro",
  "private": true,
  "type": "module",
  "scripts": { "build": "vite build" },
  "dependencies": { "@sentry/browser": "11.17.0" },
  "devDependencies": {
    "@vanilla-extract/css": "1.21.3",
    "@vanilla-extract/vite-plugin": "5.2.6",
    "vite": "8.3.8"
  }
}

vite.config.js

import { defineConfig } from "vite"
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin"

export default defineConfig({
  plugins: [vanillaExtractPlugin()],
})

index.html

<script type="module" src="/main.js"></script>

main.js

import * as Sentry from "@sentry/browser"

Sentry.init({ dsn: "https://public@example.invalid/1" })

Steps to Reproduce

  1. Create the four files above and run npm install && npm run build.
  2. Change @sentry/browser to 11.12.0 and build again.

Expected Result

The build succeeds, as it does with @sentry/browser 11.12.0.

Actual Result

With every version from 11.13.0 through 11.17.0 (I built 11.13.0, 11.14.0, 11.15.0, 11.16.0 and 11.17.0) the build fails:

✗ Build failed in 880ms
error during build:
Build failed with 3 errors:

[plugin vite-plugin-vanilla-extract] node_modules/@sentry/feedback/build/npm/esm/modal/components/Dialog.css.js
Error: Invalid exports.

You can only export plain objects, arrays, strings, numbers and null/undefined.
    at javascriptStringify.stringify.references (node_modules/@vanilla-extract/integration/dist/vanilla-extract-integration.cjs.prod.js:238:11)
    ...

The three errors are for modal/components/Dialog.css.js, core/components/Actor.css.js and screenshot/components/ScreenshotInput.css.js in @sentry/feedback; the exports it rejects are createDialogStyles, createActorStyles and createScreenshotInputStyles.

Analysis

As far as I can tell, @sentry/feedback 11.12.0 ships a single bundled build/npm/esm/index.js. From 11.13.0 on the package ships separate modules, including Dialog.css.js, Actor.css.js and ScreenshotInput.css.js. (I did not look into what changed in the build.)

@vanilla-extract/vite-plugin treats every module whose id matches /\.css\.(js|cjs|mjs|jsx|ts|tsx)(\?used)?$/ as a vanilla-extract stylesheet, including files under node_modules, and offers no option to exclude any. It evaluates the module and fails because these files export functions, not plain data. @sentry/browser imports @sentry/feedback (feedbackIntegration), so the files end up in the module graph even when the app never uses user feedback.

So the filenames clash with a widely used convention, and every project that uses vanilla-extract with the Sentry SDK breaks on upgrade.

Possible fixes on the Sentry side: name the files differently (for example Dialog.styles.js), or ship them bundled as before 11.13.

Workaround in the app's Vite config: wrap the plugin's transform so it skips node_modules/@sentry/:

const skipSentry = /[\\/]node_modules[\\/]@sentry[\\/]/
const vanillaExtract = vanillaExtractPlugin().map(plugin => {
  const transform = plugin.transform
  if (typeof transform !== "function") return plugin
  return {
    ...plugin,
    transform(code, id, ...rest) {
      return skipSentry.test(id) ? null : transform.call(this, code, id, ...rest)
    },
  }
})
// plugins: [...vanillaExtract]

Activity

  1. linear-code commented on Nov 24, 2026

    @linear-code
  2. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Nov 24, 2026
  3. logaretm commented on Nov 24, 2026

    @logaretm
    Member

    Thanks for the report, taking a look at it now.

  4. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Nov 24, 2026
  5. self-assigned this
    on Nov 24, 2026
  6. logaretm commented on Nov 24, 2026

    @logaretm
    Member

    This was a side effect of the rolldown migration, previously these files were bundled in so vanilla extract never scanned them. A simple rename seems to fix this.

  7. paulo-raca commented on Nov 25, 2026

    @paulo-raca
    Author

    This was fast! Thank you ❤️

  8. github-actions commented on Nov 25, 2026

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #26842, which was included in the 11.18.0 release.

  9. added a commit that references this issue on Nov 26, 2026
    ab44c18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions