Environment
System:
OS: macOS 12.6
CPU: (8) arm64 Apple M1
Memory: 1.03 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 16.18.0 - ~/.nvm/versions/node/v16.18.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v16.18.0/bin/yarn
npm: 8.19.2 - ~/.nvm/versions/node/v16.18.0/bin/npm
Browsers:
Brave Browser: 106.1.44.112
Chrome: 106.0.5249.119
Firefox: 104.0.2
Safari: 16.0
Reproduction URL
.
Describe the issue
Implementing a middleware.js in Next.js 13 like described here (https://next-auth.js.org/tutorials/securing-pages-and-api-routes#nextjs-middleware) results in the following error:
Server Error
TypeError: Expected an instance of Response to be returned
Call Stack
adapter
../node_modules/next/dist/esm/server/web/adapter.js (90:0)
How to reproduce
Implement Next-Auth with Next.js 13 and create a middleware.js with the following content:
export { default } from "next-auth/middleware";
Expected behavior
No fatal error
Environment
System:
OS: macOS 12.6
CPU: (8) arm64 Apple M1
Memory: 1.03 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 16.18.0 - ~/.nvm/versions/node/v16.18.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v16.18.0/bin/yarn
npm: 8.19.2 - ~/.nvm/versions/node/v16.18.0/bin/npm
Browsers:
Brave Browser: 106.1.44.112
Chrome: 106.0.5249.119
Firefox: 104.0.2
Safari: 16.0
Reproduction URL
.
Describe the issue
Implementing a middleware.js in Next.js 13 like described here (https://next-auth.js.org/tutorials/securing-pages-and-api-routes#nextjs-middleware) results in the following error:
How to reproduce
Implement Next-Auth with Next.js 13 and create a middleware.js with the following content:
Expected behavior
No fatal error