Repository navigation
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
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
- Create the four files above and run
npm install && npm run build. - Change
@sentry/browserto11.12.0and 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]Metadata
Metadata
Assignees
Projects
- StatusShow more project fieldsNo status
Activity
linear-code commentedon Nov 24, 2026
JS-4152
logaretm commentedon Nov 24, 2026
Thanks for the report, taking a look at it now.
logaretm commentedon Nov 24, 2026
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.
paulo-raca commentedon Nov 25, 2026
This was fast! Thank you ❤️
github-actions commentedon Nov 25, 2026
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.
fix(feedback): Rename `*.css.ts` style modules to `*.styles.ts` (gets…