Invalid location in sourcemap

We’re using Webpack to upload sourcemaps for every build, but I’m seeing many instances of “Invalid location in sourcemap.” The artifacts are definitely making it into their corresponding release. I’m not seeing any “NEW EVENTS” for the releases in the table under the releases tab, though.

Just to make sure: you are generating the sourcemaps and the minified files in one step and there are no mismatches? Because webpack builds are not stable.

Hi!

I’m not sure what you mean by mismatches. Also, can you clarify what you mean by “webpack builds are not stable?”

I have seen that developers build a release once without sourcemaps and then a second time with sourcemaps afterwards. The generated minified files from the first run will not work with the second run that generated the sourcemaps.

I see. In our case the build and upload are performed in the same release.

I discovered that I had not configured the release parameter when initializing Raven. I now see events appearing in our releases. I suspect this will also help with the sourcemap issue. I’ll report back with my finding. Thanks for the help.

Hey @etburke, did you find anything? I’m getting the same issue …

“Invalid location in sourcemap” can happen if the sourcemap generated does not contain enough information is is incorrect. I would check that you are using production supported sourcemaps with line and column information and that they are propertly named so that the correct release is used.

We are also getting this error. We are a Rails/React app. Our tech stack…

Ruby versions

  • Rails 6.1.3.1
  • Ruby 3.0.1
  • webpacker 5.2.1

JavaScript

  • @rails/webpacker 5.2.1
  • React 17.0.2
  • @sentry/react 6.3.1

The sourcemap file is auto-generated by webpacker at deployment time. We deploy on Heroku.

Any suggestions on how to fix the issue.

Hi @etburke , any luck ? I am also getting the same issue for some events