8000 API routes return CloudFront 503 on `next` `12.0.9` · Issue #2327 · serverless-nextjs/serverless-next.js · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.
This repository was archived by the owner on Jan 28, 2025. It is now read-only.
API routes return CloudFront 503 on next 12.0.9 #2327
@thiskevinwang

Description

@thiskevinwang

(I think this is a feature request, more than a bug 🤔)

Is your feature request related to a problem? Please describe.

When upgrading next from 12.0.8 to 12.0.9, API routes started to return a generic 503 from CloudFront.

  • Update: I'm seeing the same error message that @jakubriedl posted 1
TypeError: Cannot read property 'headers' of undefined
    at Object.apiResolver (/var/task/chunks/89.js:10564:43)
    at Module.<anonymous> (/var/task/chunks/89.js:6094:34)

A barebones API route (/api/health.ts) would return a generic 503 CloudFront error

import { NextApiHandler } from "next";

const handler: NextApiHandler = async (req, res) => {
  return res.status(200).send("OK");
};

export default handler;

Describe the solution you'd like

For these to just work with next >= 12.0.9 🙏

    "@sls-next/cdk-construct": "3.7.0-alpha.7",
    "@sls-next/lambda-at-edge": "3.7.0-alpha.7",

Describe alternatives you've considered

Pin next to 12.0.8

Additional context

vercel/next.js@v12.0.8...v12.0.9

Footnotes

  1. https://github.com/serverless-nextjs/serverless-next.js/issues/2327#issuecomment-1026500341

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0