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

Sentry Integration stop working after v1.48.4 #2164

Closed
mathewcst opened this issue Aug 21, 2024 · 7 comments · Fixed by #2165
Closed

Sentry Integration stop working after v1.48.4 #2164

mathewcst opened this issue Aug 21, 2024 · 7 comments · Fixed by #2165

Comments

@mathewcst
Copy link

mathewcst commented Aug 21, 2024

Describe the bug

I've just updated my Tanstack Router from 1.48.4 to 1.49.1.
I use Sentry to collect errors and, as soon as I updated the router version, the app stop working.

Doesn't render any pages or components.

Just throw an error: TypeError: Cannot read properties of undefined (reading 'replace').

Example available on StackBlitz.

Your Example Website or App

https://stackblitz.com/edit/github-pp1nvw?file=src%2Fmain.tsx

Steps to Reproduce the Bug or Issue

  1. Copied the Quick File Based Route example on StackBlitz
  2. Install @sentry/react, @sentry/tracing @sentry/vite-plugin
  3. Configure Sentry.init

Router doesn't work

Expected behavior

Sentry integration with Tanstack Router should work as it was in the previous versions.

Screenshots or Videos

No response

Platform

  • OS: Windows 10
  • Browser: Chrome
  • Version: 127.0.6533.120

Additional context

No response

@mathewcst mathewcst changed the title Sentry Integration stop working after v1.48.6 Sentry Integration stop working after v1.48.4 Aug 21, 2024
@mathewcst
Copy link
Author

From further testing, weirdly enough, the problem relies specifically in the dsn key of the Sentry.init object.

If you remove the dsn, every works.

Wonder what could have caused that.

@schiller-manuel
Copy link
Contributor

    /**
     * The Dsn used to connect to Sentry and identify the project. If omitted, the
     * SDK will not send any data to Sentry.
     */

so this probably does not execute the problematic code then if dsn is not present

@schiller-manuel
Copy link
Contributor

I get a different error in your example:

Screenshot 2024-08-21 at 19 52 07

@mathewcst
Copy link
Author

Although different message, the trace is apparently in the same trimPathRight function

@mathewcst
Copy link
Author

    /**
     * The Dsn used to connect to Sentry and identify the project. If omitted, the
     * SDK will not send any data to Sentry.
     */

so this probably does not execute the problematic code then if dsn is not present

Also works if you remove the Sentry.Integration line and keep the dsn. So is the combination of both that makes the error happen.

@schiller-manuel
Copy link
Contributor

I found the issue, working on a fix

@schiller-manuel
Copy link
Contributor

#2165 fixes this issue

here is your reproducer with the PR-built package: https://stackblitz.com/edit/github-pp1nvw-aay6ib?file=src%2Fmain.tsx,package.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants