Open digicoffey opened 2 weeks ago
Please try removing this option assets: './dist/**/*.js.map'
entirely. Thanks!
(assets needs to be both .js files and .js.map files. Only doing .js.map will not work.)
Thanks for the response and the guidance, much appreciated.
I have removed the assets
property completely, but I still get the same message and result.
[sentry-webpack-plugin] Debug: No `sourcemaps.assets` option provided, falling back to uploading detected build artifacts.
[sentry-webpack-plugin] Warning: Didn't find any matching sources for debug ID upload. Please check the `sourcemaps.assets` option.
Not sure if it something else in our webpack.config
that could be preventing this to work? Is there anything you think we should check?
Hmm, that usually indicates that you are using something to side-step the normal asset emission by webpack. Which webpack version are you using?
Can you try setting the assets option to ['./dist/**/*']
?
I tried your suggestion and am now getting a different issue, but at least it seems to be finding our sourcemaps.
Our webpack version is webpack@5.89.0
.
The message we are getting now is:
[sentry-webpack-plugin] Debug: Could not determine debug ID from bundle. This can happen if you did not clean your output folder before installing the Sentry plugin. File will not be source mapped: /path/dist/app.min.js
Ok, that message means that one of the files the plugin found wasn't injected with debug IDs. Are you sure the file isn't a leftover from when you had a build before? Is that file part of your build output?
It's pretty hard to debug this just from debug messages. Would you mind sharing a minimal reproduction example? Depending on your webpack setup there may be third parties that mess with what our plugin does. (Our plugin doesn't do anything too funky so something else is likely doing something shady)
Apologies for the delay in getting back to you. Had a priority change today. I will try and get a minimal reproduction to you, but it won't be until next week as I have a few things I need to take care of.
There is quite a lot going on in our webpack, so I'm guessing there must be an issue in there somewhere.
Thanks for your advice and patience.
Environment
@sentry/react@7.65.0
@sentry/webpack-plugin@2.20.1
Steps to Reproduce
Expected Result
Sourcemaps are injected with a
debug_id
Sourcemaps are uploadedActual Result
Sourcemaps are not injected with a
debug_id
Sourcemaps are not uploadedsentry-webpack-debug-id-upload-plugin[sentry-webpack-plugin] Warning: Didn't find any matching sources for debug ID upload. Please check the 'sourcemaps.assets' option.
Context
We have been using the
sentry-cli
to injectdebug_id
's and upload our sourcemaps:We wanted to remove this step from our
CI
and integrate this as part of our build step using the@sentry/webpack-plugin
plugin, but we haven't been able to get it working.Our assumption, which could be incorrect, is that the
inject: true
property would handle the injection of thedebug_id
's, but the plugin can't seem to find them. We have tried changing oursourcemaps.assets
to be more and less specific, but nothing seems to work.If we provide the legacy property, ie:
The upload of the sourcemaps works, but no
debug_id
's are injected. Any guidance/advice would be appreciated.We realise that
debug_id
's are not mentioned in the documentation, but we thought that maybe theinject: true
property would handle this?