Sourcemap was invalid or not parseable

I am facing strange behavior from sentry. I use sentry-webpack-plugin to upload my sourcemaps to remote company sentry server. Everything seems to be allright. I see sourcemaps under artifacts in release tab.

But the thing is, that in some cases soursemaps are mapped correctly, but in other sentry shows minified error code with warning “Sourcemap was invalid or not parseable” (Even on the same error)

I did a little research, on sentry forum some pointed that it could be because of gzipped sourcemap when uploading artifact. But why then in some cases it works, and not works in others?

Here is example: one error appear two times in sentry, but first is mapped correctly to sources, second is not

Valid mapping:

Mapped exception from sentry

Invalid mapping:

NOT mapped exception from sentry

In the main.js last line is:

//#sourceMappingURL=vendor.d5b6708d.js.map

My source maps are uploaded to sentry, and the deleted from static server which serves main.*.js via WebpackDeleteAfterEmit plugin.

Hi, I am getting exactly the same thing happening on sentry.io.

It is really frustrating as this platform seems so good, and I am trying it out exactly so that I can see the sourcemaps to help with debugging issues on production.

I am uploading the source maps using the bash script

export SENTRY_ORG=nathtech
SENTRY_PROJECT=growspace
PACKAGE_VERSION=`cat package.json \
  | grep version \
  | head -1 \
  | awk -F: '{ print $2 }' \
  | sed 's/[",]//g' \
  | tr -d '[[:space:]]'`

JS_DIR="./build/static/js"
VERSION=$SENTRY_PROJECT@$PACKAGE_VERSION

# Create a release
echo "\ncreating sentry release " $VERSION
./node_modules/.bin/sentry-cli releases new $VERSION --project $SENTRY_PROJECT --finalize

# Upload js and sourcemap 
echo "\nUploading Source maps, which should also create a release :)"
./node_modules/.bin/sentry-cli releases --project $SENTRY_PROJECT files $VERSION upload-sourcemaps $JS_DIR --rewrite

# Associate commits with the release
./node_modules/.bin/sentry-cli releases set-commits --auto $VERSION

# delete sourcemap files
echo "\nRemoving js sourcmap files"
rm $JS_DIR/*.map

In an issue for this release I get the error:

Sourcemap was invalid or not parseable
Url https://{my-production-host}/static/js/8.dc20aaa5.chunk.js.map

But I can download the map from the project release artifacts page and open and read it fine.
The .map files are all listed in the release artifacts page as e.g.

~/8.dc20aaa5.chunk.js.map

I have tried all sorts of things such as adding --rewrite option to the upload-sourcemaps, --prefix-url ‘~/static/js’, but nothing.

Also potentially connected to this happening is a duplicate listing of say release 1.2.9 on the release list, the first of which has the commits and sourcemaps attached to it, the second of which has the issue attached to it. Not sure if that means that the sourcemaps which aren’t in the second release are therefor not there?

Any help in moving forward to solve this issue would be amazing and make switching to using this platform the right decision.

Thanks