Source code was not found for main.js

I have spent hours trying to get sourcemaps to work with sentry with no luck so far.

I have uploaded main.js and main.js.map using the sentry-cli. I tried both the url-prefixes ~/main.js.map and /main.js.map. However, it still reports errors when processing a new event:

There were 3 errors encountered while processing this event
Source code was not found for /main.js
{
  "url": "/main.js"
}

I validated that the sourcemaps are correct by checking the safari debugger on the device, as well as using the line numbers from sentry in the source map. Both worked fine.
The source maps and the error are also located in the right release. I also made sure the source maps were uploaded before the error occurred.

It still seems that the source maps are not found by sentry. I read through all the recent threads here on the forums, as well as all the github issues I could find.

Do you have any suggestions?
Thanks a lot.

EDIT:

I just noticed that when I try to upload it with --url-prefix / and --validate, I get an error:

Running with sourcemap validation
  /main.js
    Error: failed to process: relative URL without a base
  /main.js.map
error: Encountered problems when validating sourcemaps.

But when I don’t include --url-prefix and just use --validate, the upload works:

Running with sourcemap validation
  ~/main.js
  ~/main.js.map
All Good!

Not sure if that tells you something…

Exactly the same issue here, when trying to use Sentry for a React Native app.

If I understand correctly, this isn’t really related to sourcemaps - Sentry is saying that it can’t even find the source code, let alone the sourcemap (the code contains the link to the sourcemap).

I’m uploading a new release with artifacts, then triggering an error, which shows as being linked to the correct version, but Sentry always acts like the artifacts don’t exist. I’ve tried a few different naming schemes (for both the error url and artifact name):

/main.js
Error in JSON: {"url":"/main.js","type":"js_no_source"}

http://example.com/main.js
Error in JSON: {"url":"http://example.com/main.js","type":"fetch_invalid_http_code","value":404}

The same issue here. I have no idea where to try find an solution.

If you are using react-native please make sure you are using the new sentry-react-native integration. The old one (raven-js) has various known issues with sourcemap matching.

If this is for another platform please share the exact issues you are encountering.

I am using Sentry with Expo, how am I supposed to switch to sentry-react-native? Thanks!

I am using Expo in my project, how can I fix this issue??