The edge functions are crashing when deployed to Vercel
See original GitHub issueWhat version of Next.js are you using?
12.0.3
What version of Node.js are you using?
14.18.1
What browser are you using?
Chrome
What operating system are you using?
macOS
How are you deploying your application?
Vercel
Describe the Bug
The edge functions are crashing when deployed to Vercel
This is the error TypeError: (intermediate value)(intermediate value).push(…) is not a function at Object.<anonymous>
Expected Behavior
The edge function should redirect to the login page if the cookie is not found
To Reproduce
create _middleware.tsx file and add the following content.
import type { NextRequest } from "next/server";
import { NextResponse } from "next/server";
export const middleware = (req: NextRequest) => {
const cookie = req.cookies["auth"];
if (!cookie) {
return NextResponse.redirect("/login");
}
};
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (5 by maintainers)
Top Results From Across the Web
Edge Functions – Vercel Docs
Edge Functions are deployed globally on our Edge Network, and can automatically execute in the region nearest to the user who triggers them....
Read more >This edge function has crashed - The deployment failed while ...
I understand that Edge Functions are still Beta and that we might have been to eager with using them in production already.
Read more >I get "This Serverless Function has crashed." When I deploy ...
This error comes after deployment of your web app. This is an error by checkly. Checkly checks that is every page is loading...
Read more >Zeitgeist on the App Store
Zeitgeist helps you stay on top of your Vercel deployments. ... Prompts for a sign in through Vercel but immediately crashes with an...
Read more >Vercel vs. Netlify: Jamstack Deployment Comparison - Snipcart
Here's what I'll cover: What is a deployment pipeline? What are their features? What's the workflow? What serverless functions ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, this should be resolved by disabling
swcMinify
for now, we are investigating this though.For me as well - thanks for reporting 😃