question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The edge functions are crashing when deployed to Vercel

See original GitHub issue

What 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:closed
  • Created 2 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
ijjkcommented, Nov 8, 2021

Hi, this should be resolved by disabling swcMinify for now, we are investigating this though.

1reaction
wiessoncommented, Nov 9, 2021

For me as well - thanks for reporting 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found