Skip to content

Nextjs 404 errors on /monitoring url with Netlify deploy #8869

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

Closed
3 tasks done
andrei-cacio opened this issue Aug 25, 2023 · 9 comments
Closed
3 tasks done

Nextjs 404 errors on /monitoring url with Netlify deploy #8869

andrei-cacio opened this issue Aug 25, 2023 · 9 comments
Labels
Package: nextjs Issues related to the Sentry Nextjs SDK Stale

Comments

@andrei-cacio
Copy link

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

7.64.0

Framework Version

Next 13.4.13, React 18

Link to Sentry event

No response

SDK Setup

Sentry.init({
  dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,

  environment: process.env.NEXT_PUBLIC_SENTRY_ENV,

  // Adjust this value in production, or use tracesSampler for greater control
  tracesSampleRate: 1,

  // Setting this option to true will print useful information to the console while you're setting up Sentry.
  debug: false,

  replaysOnErrorSampleRate: 1.0,

  // This sets the sample rate to be 10%. You may want this to be 100% while
  // in development and sample at a lower rate in production
  replaysSessionSampleRate: 0.1,

  // You can remove this option if you're not planning to use the Sentry Session Replay feature:
  integrations: [
    new Sentry.Replay({
      // Additional Replay configuration goes in here, for example:
      maskAllText: true,
      blockAllMedia: true,
    }),
  ],
});

Steps to Reproduce

I used the wizard to set up sentry. I installed the Sentry integration plugin in Netlify. I hooked Gitlab with Sentry and connected the repository.

The server side errors of Nextjs get reported fine in Sentry. However the client errors return 404 when hitting the monitoring endpoint.

On my local environemnt everything works fine. Both server and client errors get reported in sentry fine and the monitoring tunnel rewrite works.

Expected Result

The monitoring endpoint should return 201.

Actual Result

It returns 404.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 Aug 25, 2023
@github-actions github-actions bot added the Package: nextjs Issues related to the Sentry Nextjs SDK label Aug 25, 2023
@lforst
Copy link
Member

lforst commented Aug 28, 2023

The SDK uses Next.js rewrites in order to tunnel events in order to circumvent ad blockers. It might be possible that Netlify doesn't support rewrites. I found this.

To turn off the tunneling functionality remove the tunnelRoute option inside your next.config.js.

@skopz356
Copy link

I am having this issue too, removing tunnelRoute helped, but I would rather use tunneling.

@getsantry getsantry bot moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 Aug 29, 2023
@lforst
Copy link
Member

lforst commented Aug 29, 2023

I am having this issue too, removing tunnelRoute helped, but I would rather use tunneling.

This is something you have to figure out with Netlify I suppose. Off of Netlify everything works fine. Feel free to report back if you find a solution and maybe we can make this work out of the box.

@andrei-cacio
Copy link
Author

The SDK uses Next.js rewrites in order to tunnel events in order to circumvent ad blockers. It might be possible that Netlify doesn't support rewrites. I found this.

To turn off the tunneling functionality remove the tunnelRoute option inside your next.config.js.

thank you @lforst this worked.

@getsantry getsantry bot moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 Sep 19, 2023
@getsantry getsantry bot removed the status in GitHub Issues with 👀 Sep 19, 2023
@getsantry getsantry bot moved this to Waiting for: Community in GitHub Issues with 👀 Sep 19, 2023
@getsantry
Copy link

getsantry bot commented Oct 11, 2023

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added the Stale label Oct 11, 2023
@getsantry getsantry bot closed this as completed Oct 19, 2023
@merdoyovski
Copy link

Still having this issue, it works when tunneling is removed but that seems to prevent ad-blocker embedded browsers not being able to use it. For example, I can send a user feedback (using the widget) from Chrome, but unable to do it on Brave.

@aprilmintacpineda
Copy link

aprilmintacpineda commented May 19, 2024

I'm getting the same issue with NextJS with Sentry on Vercel. Works on local development but in Vercel I get 404. Not a lot of search results.

@lforst
Copy link
Member

lforst commented May 21, 2024

Please open a new issue and provide minimal reproduction if you experience this off of Netlify. The tunnelRoute option does not work on Netlify (due to a limitation with Netlify). If you experience this issue with other hosting providers, we need to look at it in more detail. Thanks!

@BarneyGammond
Copy link

I've opened a new issue which I think may be linked to this #16128, this issue occured when using Cloudflare.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: nextjs Issues related to the Sentry Nextjs SDK Stale
Projects
Archived in project
Development

No branches or pull requests

6 participants