Sentry Source Maps Not Uploading Properly with vite-plugin-ruby #532
gabrielgiroereelon
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
I’m using vite-plugin-ruby with @sentry/vite-plugin to upload source maps for my Rails + Vite application, but the source maps are not being properly detected or linked in Sentry.
When I build the project (yarn build), the .map files are generated in ./public/assets, and my JavaScript files contain sourceMappingURL references. However, when I upload the source maps using sentry-cli, some files are missing proper source map references, and Sentry logs warnings like:
warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for ~/action_cable-5212cfee.js)
Additionally, when running:
npx sentry-cli sourcemaps upload ./public/assets
--org="reelon-technologies-pvt-ltd"
--project="reelon"
--auth-token=$SENTRY_AUTH_TOKEN
I get an error:
error: Failed to process uploaded files: uploading a bundle without debug ids or release is prohibited
Steps to Reproduce
1. Set up vite.config.mts:
```
import { sentryVitePlugin } from "@sentry/vite-plugin";
import { defineConfig } from 'vite'
import RubyPlugin from 'vite-plugin-ruby'
export default defineConfig({
plugins: [
RubyPlugin(),
sentryVitePlugin({
org: "reelon-technologies-pvt-ltd",
project: "reelon",
authToken: process.env.SENTRY_AUTH_TOKEN,
})
],
build: {
sourcemap: true
}
})
import * as Sentry from "@sentry/browser";
Sentry.init({
dsn: process.env.SENTRY_DSN,
integrations: [
Sentry.replayIntegration({
maskAllText: false,
blockAllMedia: false,
}),
],
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
tracesSampleRate: 1.0,
});
console.log("✅ Sentry initialized on frontend with Replay");
Beta Was this translation helpful? Give feedback.
All reactions