Closed gr-qft closed 2 years ago
First thanks for this great library, it's so useful for working with mdx files.
I've noticed that when having a middleware file,
import { NextRequest, NextResponse } from "next/server"; export function middleware(req: NextRequest) { const basicAuth = req.headers.get("authorization"); if (basicAuth) { const auth = basicAuth.split(" ")[1]; const [user, pwd] = Buffer.from(auth, "base64").toString().split(":"); if (user === "xxx" && pwd === "xxxxxx") { return NextResponse.next(); } } return new Response("Auth required", { status: 401, headers: { "WWW-Authenticate": 'Basic realm="Secure Area"', }, }); }
Then running the watch command triggers the following error
Error: To use middleware you must provide a `hostname` and `port` to the Next.js Server
But running just yarn dev doesn't cause any error.
yarn dev
Would really appreciate it if this can be looked into 👍 !
Closed by #35
First thanks for this great library, it's so useful for working with mdx files.
I've noticed that when having a middleware file,
Then running the watch command triggers the following error
But running just
yarn dev
doesn't cause any error.Would really appreciate it if this can be looked into 👍 !