TLDR
Just add /tunnel
or /monitoring
routes to your Next.js middleware matcher ignored list, these routes should be rewritten to Sentry’s service, don’t need to be handled by your Next.js middleware.
Sentry is a popular service used to monitor product errors, which Quotion is also using.
I build Quotion with Vercel Platforms Starter Kit, and Sentry works well with this shiny new technology. However, we encountered an HTTP 405 error on our production, like this:
I checked the Sentry docs, but nothing helped. One day, while searching for something inside the Next.js build output folder .next
, I found that the Sentry /tunnel
API is being used for rewriting to Sentry's API:
That's when I realized why this 405 error was occurring. Vercel Platforms Starter Kit rewrites almost everything to subfolders to create a multi-tenancy platform. Therefore, we need to bypass this special /tunnel
API in the Next.js middleware. Based on my middleware matcher configuration, I only need to change the Sentry configuration to **/api/tunnel**
. For example, this is my middleware configuration:
If you don't want to change the Sentry configuration, you can also add your Sentry API to the matcher RegExp:
engineering
nextjs
Create your blogs directly from Apple Notes.
Say goodbye to complex CMS updates and management issues!
You focus on creating quality content while Quotion takes care of the rest.
Latest
More from the blog
Qing
Introducing Realtime Preview
Today, we're excited to announce, Quotion supports Realtime Preview now. You can preview your latest changes on your Quotion sites in realtime, no more refresh your page manually. Demo :::note Click any pen links will load your site in realtime preview mode. You don't need to click every post via the pen. ::: Checkout our
Read post
Qing
Introducing KaTeX
Many students are using Quotion. One of the most wanted features is KaTeX for math. Today, we're excited to share that Quotion now supports KaTeX out of the box. 🔥 Preview The note: The post: Tech details We need KaTeX css to render expressions correctly, but it is a pretty big chunk, to reduce the
Read post
Qing
Introducing comment widgets
Today, we are excited to announce a new feature on Quotion - comment widgets! This feature allows our valued customers to engage with their readers easily and create a sense of community around their content. The best part? You don't need to use any 3rd-party solutions to enable it! How to enable it Go to
Read post