-
Notifications
You must be signed in to change notification settings - Fork 29.5k
Closed
Labels
bugIssue was opened via the bug report template.Issue was opened via the bug report template.
Description
Verify canary release
- I verified that the issue exists in Next.js canary release
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000
Binaries:
Node: 16.13.1
npm: 8.5.4
Yarn: 3.2.0-rc.10
pnpm: N/A
Relevant packages:
next: 12.1.1-canary.10
react: 17.0.2
react-dom: 17.0.2
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
./pages/foo/_middleware.ts
Error: next/server should not be imported outside of pages/_middleware.js. See https://nextjs.org/docs/messages/no-server-import-in-page. @next/next/no-server-import-in-page
ESlint error occurs in nested route middleware not root middleware.
I think this error is similar to #32156
Expected Behavior
No lint error
To Reproduce
- Create nested foo directory in pages. (e.g. ./pages/foo)
- Create _middleware.ts file in foo.
- Run
yarn lint
.
Metadata
Metadata
Assignees
Labels
bugIssue was opened via the bug report template.Issue was opened via the bug report template.