-
Notifications
You must be signed in to change notification settings - Fork 86
[Bug]: Running Next Dev locally with MiddlewareRequest causes error #2003
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
Comments
Hi @isaac-martin . I am unable to duplicate this behaviour. Here are the steps I took:
I am seeing the site running with no errors. Let me know what you have done differently than this to get your result. |
Closing as stale |
Sorry @sarahetter have been off work for the last few months. Am i correct in assuming that you are running your local dev environment with |
Yes, I was running with I'll create an issue to make this clearer in the documentation. |
I am experiencing the same issue, even when running To reproduce, I followed the steps above. I created a new next project (tried with several different options, app/pages, src, etc), installed Then I get:
My versions:
Can we please reopen this issue? EDIT: even the demo app from Netlify itself for NextJS edge middleware seems broken... https://next-edge-middleware.netlify.app/ |
Summary
Running
next dev
locally withMiddlewareRequest
inside middleware.ts causes an errorMiddlewareRequest only works in a Netlify Edge Function environment
If you have to run locally using
netlify dev
this should be called out inside the documentation.Subsequently there is a typescript error also
Types of property 'geo' are incompatible.
Steps to reproduce
Inside middleware.ts
import { MiddlewareRequest } from "@netlify/next";
create a new netlify middleware request with the below code
const request = new MiddlewareRequest(req);
go to a url in browser and notice the error
A link to a reproduction repository
No response
Next Runtime version
x
Is your issue related to the
app
directory (beta)?app
directoryMore information about your build
netlify.toml
)What OS are you using?
Mac OS
Your netlify.toml file
`netlify.toml`
# Paste content of your `netlify.toml` file here
Your public/_redirects file
`_redirects`
Your
next.config.js
file`next.config.js`
Builds logs (or link to your logs)
Build logs
Function logs
Function logs
.next JSON files
generated .next JSON files
The text was updated successfully, but these errors were encountered: