Comments (8)
the official plugin uploads batched
from sentry-javascript-bundler-plugins.
I might have solved it by investigating your suggestion or using a relative path. Just deleted the append
option and let the plugins do their thing. Still need to verify in prod. Thanks for your help.
from sentry-javascript-bundler-plugins.
Hi, webpack-sentry-plugin
is not maintained by Sentry. If you have an issue with it, please open one over at their repo https://github.com/40thieves/webpack-sentry-plugin.
Or you can use the official Sentry webpack plugin: https://www.npmjs.com/package/@sentry/webpack-plugin
from sentry-javascript-bundler-plugins.
Hi,
webpack-sentry-plugin
is not maintained by Sentry. If you have an issue with it, please open one over at their repo https://github.com/40thieves/webpack-sentry-plugin.Or you can use the official Sentry webpack plugin: https://www.npmjs.com/package/@sentry/webpack-plugin
Oh, embarrassing. Thank you, I will switch to the official.
from sentry-javascript-bundler-plugins.
@lforst Is this likely to be a nonissue with the official plugin?
from sentry-javascript-bundler-plugins.
@lforst sorry, hopefully last question, and apologies if this is the wrong place for these questions. Trying to get the new plugin running, and a lot of the documentation around this specific issue seems to point to legacy implementations. Quick question about how to transform the old plugin usage from the following:
Original Implementation
new SentryPlugin({
organisation: 'org-name',
project: process.env.SENTRY_PROJECT_NAME,
apiKey: process.env.SENTRY_API_KEY,
filenameTransform: (filename) => `~/assets/react/${filename}`,
release: (hash) => process.env.SOURCE_VERSION || hash,
suppressConflictError: true
}),
// Creates sourcemaps and customizes the directive
new webpack.SourceMapDevToolPlugin({
filename: '[file].map',
append: '\n//# sourceMappingURL=/assets/react/[url]',
exclude: /vendor_bundle|DateFnsLocale-es/
})
My first attempt worked in test environments, but on prod (because we use a CDN) the asset didn't match.
The path for this stack frame is https://example.cloudfront.net/assets/react/client_bundle.e375ad82cbb523fbebc5.js and the release value for this event is *****.
Sentry was not able to find a file in the release's artifacts that matches one of the following paths:
https://example.cloudfront.net/assets/react/client_bundle.e375ad82cbb523fbebc5.js
~/assets/react/client_bundle.e375ad82cbb523fbebc5.js
While the artifact bundle has:
Sourcemap Reference: /assets/react/client_bundle.e375ad82cbb523fbebc5.js.map
Failed Implementation
sentryWebpackPlugin({
org: 'org-name',
project: process.env.SENTRY_PROJECT_NAME,
authToken: process.env.SENTRY_AUTH_TOKEN,
release: { name: process.env.SOURCE_VERSION }
}),
// Creates sourcemaps and customizes the directive
new webpack.SourceMapDevToolPlugin({
filename: '[file].map',
append: '\n//# sourceMappingURL=/assets/react/[url]',
exclude: /vendor_bundle|DateFnsLocale-es/
})
Note the append: '\n//# sourceMappingURL=/assets/react/[url]',
in the second plugin.
For my next try, I updated that to append: '\n//# sourceMappingURL=~/assets/react/[url]',
with a ~/
. Is this the recommended way to handle this? Which I have not deployed yet.
I noticed that a lot of the issues around this issue talked about urlPrefix
but that appears to be in the legacy version.
There are also sourcemaps.rewriteSources
and rewriteFramesIntegration
but I was a little unclear on whether those were meant to address this issue, or if my update above was enough...before I break Prod again.
from sentry-javascript-bundler-plugins.
/assets/react/client_bundle.e375ad82cbb523fbebc5.js.map
is technically incorrect because it is an absolute path. I assume you don't actually have your assets live under this absolute path.
If you change the sourceMappingUrl to a relative path pointing to the source map from the source file, everything should work.
from sentry-javascript-bundler-plugins.
Our assets are stored in a flat structure in an s3 bucket named assets/react
so on prod all the built code can be found at https://example.cloudfront.net/assets/react/
so for example https://example.cloudfront.net/assets/react/client_bundle.205ea7def2e26d2f79f8.js
and https://example.cloudfront.net/assets/react/vendor_bundle.a7c14cf7e074571d2905.js
regardless of current page path. Is that what you mean?
from sentry-javascript-bundler-plugins.
Related Issues (20)
- reactComponentAnnotation. I use an unintended value for a prop. HOT 1
- Sentry Vite Plugin throws error while building the app: TypeError: Converting circular structure to JSON HOT 2
- error: release not found HOT 6
- sentry-vite + CDN sourcemaps not working HOT 30
- esbuild plugin's debug ID generation is not deterministic HOT 6
- Cannot read properties of undefined (reading "silent") HOT 2
- Should inject banner code after `use strict` HOT 1
- Sourcemap upload not working for `.mjs` files HOT 2
- esbuild plugin: You are attempting to use this endpoint too frequently HOT 4
- sentry-webpack-plugin + electron(-forge) breaks universal builds HOT 1
- Webpack plugin causes Typescript build errors when React component annotation is enabled HOT 1
- Add `bundlesizeOptimizations` options to docs
- Source map loaded and connected to release, but still don't see any readable trace HOT 4
- Webpack plugin uploads source maps on development mode HOT 2
- VSC Debugger doesn't stop at breakpoint in TypeScript (ts) file but in Vue file
- Verbose console print from [sentry-vite-plugin] HOT 6
- Source Maps aren't mapped when working with docker HOT 5
- vite-plugin uploads sourcemaps when building for development HOT 1
- Sourcemapping broken with vite 5.1.7 and 5.2.10 HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sentry-javascript-bundler-plugins.