ElMassimo / ElMassimo/vite_ruby

Sentry Source Maps Not Uploading Properly with vite-plugin-ruby

Open
#533 1 comment 0 reactions 0 assignees View on GitHub
bug: pending triage
Dominant language
Ruby
Stars
1.6k
Forks
149
Avg merge
5h 13m
Merged PRs (30d)
2

Description

[troubleshooting section]: https://vite-ruby.netlify.app/guide/troubleshooting.html

- [x ] I have tried upgrading by running `bundle update vite_ruby`.
- [ ] I have read the __[troubleshooting section]__ before opening an issue.

### 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.
### Reproduction 🐞

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
}
})
```

Initialize Sentry in app/javascript/application.js:
```
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");
```

Vite Ruby Info

_Run `bin/rake vite:info` and provide the output:_

```
bin/vite present?: true
vite_ruby: 3.9.1
vite_rails: 3.0.19
rails: 8.0.1
ruby: ruby 3.3.6 (2024-11-05 revision 75015d4c1f) [arm64-darwin24]
node: v20.17.0
npm: 10.8.2

installed packages:
jumpstart-app@ /Users/georgelgabrielgiroe/developer/make_software/reelon
├─┬ vite-plugin-ruby@5.1.1
│ └── vite@6.0.11 deduped
└── vite@6.0.11
```

### Logs 📜

_If not providing a reproduction:_

Output

_Run `DEBUG=vite-plugin-ruby:* bin/vite dev` or `DEBUG=vite-plugin-ruby:* bin/vite build` and provide the output:_

```
bin/vite build ─╯
Building with Vite ⚡️
[sentry-vite-plugin] Info: Using environment variables configured in ".env.sentry-build-plugin".
vite v6.0.11 building for production...
[sentry-vite-plugin] Info: Sending telemetry data on issues and performance to Sentry. To disable telemetry, set `options.telemetry` to `false`.
transforming...
✓ 2 modules transformed.
rendering chunks...
computing gzip size...
../../public/vite/.vite/manifest-assets.json 0.00 kB │ gzip: 0.02 kB
../../public/vite/.vite/manifest.json 0.19 kB │ gzip: 0.12 kB
../../public/vite/assets/application-CwCkNKtt.js 0.69 kB │ gzip: 0.40 kB │ map: 1.12 kB
> Found 2 files
> Analyzing 2 sources
> Adding source map references
> Bundled 2 files for upload
> Bundle ID: 44e604f0-80c8-59a3-933b-207a0f15296a
> Uploaded files to Sentry
> File upload complete (processing pending on server)
> Organization: reelon-technologies-pvt-ltd
> Project: reelon
> Release: 6600a9d66521a86208c43671bbdc8ad958cbb108
> Dist: None
> Upload type: artifact bundle

Source Map Upload Report
Scripts
~/26562f37-4db8-4dd8-a8a4-12e0bdea2a74-0.js (sourcemap at application-CwCkNKtt.js.map, debug id 26562f37-4db8-4dd8-a8a4-12e0bdea2a74)
Source Maps
~/26562f37-4db8-4dd8-a8a4-12e0bdea2a74-0.js.map (debug id 26562f37-4db8-4dd8-a8a4-12e0bdea2a74)
[sentry-vite-plugin] Info: Successfully uploaded source maps to Sentry
✓ built in 3.36s
Build with Vite complete: /Users/georgelgabrielgiroe/developer/make_software/reelon/public/vite
```

Any insights or guidance on how to properly configure vite-plugin-ruby for source map uploads would be greatly appreciated.🙏

### Screenshots 📷

_Provide console or browser screenshots of the problem_.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.