Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native Web - sentry/browser - sourcemap not working #4422

Open
nada-zheng opened this issue Jan 8, 2025 · 2 comments
Open

React Native Web - sentry/browser - sourcemap not working #4422

nada-zheng opened this issue Jan 8, 2025 · 2 comments

Comments

@nada-zheng
Copy link

nada-zheng commented Jan 8, 2025

What React Native libraries do you use?

React Native Web

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

"@sentry/browser": "7.109.0"

How does your development environment look like?

Node: v20.9
os: macOS
yarn: 1.22

Sentry.init()

 Sentry.init({
            dsn,
            release: `${platform}-v${version}`,
            environment,
            tracesSampleRate,
            integrations: [
                Sentry.browserTracingIntegration(),
                httpClientIntegration({
                    failedRequestStatusCodes: [
                        [400, 499],
                        [500, 599],
                    ],
                }),
                new ApiRateLimitIntegration(),
            ],

Steps to Reproduce

I upload the sourcemap by this command
const createRelease = sentry-cli releases new ${releaseVersion} --org ${sentryEnv.defaults.org} --project ${sentryEnv.defaults.project};
const command = sentry-cli releases files ${releaseVersion} upload-sourcemaps ${distPath} --rewrite --url-prefix '~/${prefix}' --org ${sentryEnv.defaults.org} --project ${sentryEnv.defaults.project};

the source map uploaded success, but it doesn't work

Image Image

Expected Result

The sourcemap works correctly

Actual Result

The sourcemap doesn't work

@krystofwoldrich
Copy link
Member

krystofwoldrich commented Jan 10, 2025

Hi @nada-zheng,
thank you for the message and the details.

Just to confirm, are you using @sentry/react-native or @sentry/browser?


I understand that the domain is hidden for privacy reason. But I want to make sure it's just the domain and the ~/ prefix only replaces the domain.

The ~ is used in Sentry to replace the scheme and domain. It is not a glob!

http://example.com/dist/js/script.js will match ~/dist/js/script.js or http://example.com/dist/js/script.js

but will NOT match ~/script.js.

https://docs.sentry.io/platforms/javascript/sourcemaps/troubleshooting_js/legacy-uploading-methods/#using-the-

@getsantry getsantry bot moved this to Waiting for: Community in GitHub Issues with 👀 3 Jan 10, 2025
@krystofwoldrich krystofwoldrich moved this from Needs Discussion to Needs More Information in Mobile & Cross Platform SDK Jan 10, 2025
@krystofwoldrich krystofwoldrich changed the title sourcemap not working React Native Web - sentry/browser - sourcemap not working Jan 10, 2025
@nada-zheng
Copy link
Author

HI, @krystofwoldrich, thanks for your response, I use the @sentry/browser
and I only hide my domain, so my full path is https://mydomain/crm/salesforce/main.js, and I also didn't use the dist

@getsantry getsantry bot moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 3 Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Product Owner
Status: Needs More Information
Development

No branches or pull requests

2 participants