-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Vercel 504 on all API routes #15280
Comments
Hello, thanks for writing in. Can you please provide a minimal reproduction example? |
Sorry, I had to rip out my Sentry integration to have a working site, so a repro would be a lift. I just followed the docs for integration Sentry/Next/Sentry with the tunneling and then had a |
@saiichihashimoto could you maybe share your next config file in the state that caused the issue? |
const { withSentryConfig: withSentryConfigRaw } = require("@sentry/nextjs");
const { flow } = require("lodash/fp");
const withBundleAnalyzer = require("@next/bundle-analyzer");
const withSentryConfig =
(
/** @type {import("@sentry/nextjs").SentryBuildOptions | undefined} */ sentryBuildOptions
) =>
(/** @type {import('next').NextConfig} */ config) =>
withSentryConfigRaw(config, sentryBuildOptions);
/**
* @type {import('next').NextConfig}
*/
const config = {
transpilePackages: ["@REDACT/*"],
pageExtensions: ["page.tsx", "page.ts", "page.jsx", "page.js"],
productionBrowserSourceMaps: true,
eslint: {
ignoreDuringBuilds: true,
},
experimental: {
instrumentationHook: true,
swcPlugins: [
[
"next-superjson-plugin",
{
excluded: [],
},
],
],
},
headers: async () => [
{
source: "/assets/:asset*",
headers: [
{
key: "cache-control",
value: "public, immutable, max-age=31536000",
},
],
},
],
images: {
remotePatterns: [
{
protocol: "https",
hostname: "lh3.googleusercontent.com",
port: "",
},
],
},
};
/**
* @type {import('next').NextConfig}
*/
module.exports = flow(
withSentryConfig({
automaticVercelMonitors: true,
debug: Boolean(process.env.CI),
disableLogger: true,
hideSourceMaps: true,
org: REDACT,
project: REDACT,
silent: !process.env.CI,
tunnelRoute: "/monitoring",
widenClientFileUpload: true,
reactComponentAnnotation: {
enabled: true,
},
}),
withBundleAnalyzer({
enabled: process.env.ANALYZE === "true",
})
)(config); |
Not familiar with Generally I would recommend to not alter the default export of |
It's just functional programming, it effectively just calls the functions. There's no side effects. |
I am just wondering if the It should resemble this, am I right? withSentryConfig(
withBundleAnalyzer({ /* Next.js config */}),
{ /* Sentry options */ }
) I think this would be the correct way of doing this: module.exports = flow(
withBundleAnalyzer({
enabled: process.env.ANALYZE === "true",
}),
config => withSentryConfig(config, {
/* Sentry options */
})
)(config); Maybe try to create the config without currying it. |
Another thing: found an old issue with |
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
8.33.0-8.54.0
Framework Version
8.33.0-8.54.0
Link to Sentry event
No response
Reproduction Example/SDK Setup
No matter what I do, my endpoints are all hanging with a vercel 504 error. Sometimes they come through, but rarely. It's only on
/api/*
routes as all my pages load, though I'm not doing anyget*
methods on them. When I completely remove Sentry from my codebase, everything is extremely fast and there are no errors whatsoever. It works runningnext dev
locally, but only fails like this when deployed to vercel. All my environment variables are fine.Steps to Reproduce
No matter what I do, my endpoints are all hanging with a vercel 504 error. Sometimes they come through, but rarely. It's only on
/api/*
routes as all my pages load, though I'm not doing anyget*
methods on them.Expected Result
Every API shouldn't be returning a 504 error.
Actual Result
Every API shouldn't be returning a 504 error.
The text was updated successfully, but these errors were encountered: