Skip to content

Middleware doesn't run in root directory #118

@only1drhex

Description

@only1drhex

Improve documentation

Link

[
Add a link to the page which needs improvement (if relevant)]
(https://supabase.com/docs/guides/auth/server-side/nextjs?queryGroups=router&router=app)

Describe the problem

middleware doesn't run in root_folder/middleware.ts for next js 14 to 15

the middleware.ts file should be in
src/middleware.ts for at least nextjs 14 to 15

/my-next-app
├─ src/
│ ├─ middleware.js <-- here
│ └─ app/
├─ next.config.js
└─ package.json

not root/middleware.ts this causes all sorts of authentication errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions