Error: Mapping middleware not found. Maybe you provided a wrong middlewarePath? Available paths: middleware
See original GitHub issueVerify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:22 PDT 2022; root:xnu-8020.121.3~4/RELEASE_X86_64
Binaries:
Node: 16.13.0
npm: 8.1.0
Yarn: 1.22.17
pnpm: 7.0.0
Relevant packages:
next: 12.2.1-canary.2
eslint-config-next: 12.2.0
react: 18.2.0
react-dom: 18.2.0
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
Actually, I’m using Monorepo with turborepo and one of the apps is a next.js with middleware, so when trying to deploy at vercel, I received this error:
Error: Mapping apps/web/middleware not found. Maybe you provided a wrong middlewarePath? Available paths: middleware
At first, I understood that it was a platform error, however, after contacting the platform, I received a message saying that they do not solve problems related to the code.the
Expected Behavior
Just deploy correctly
Link to reproduction
https://github.com/emersonlaurentino/reproduce-next-middleware-error
To Reproduce
Try to deploy this repository on Vercel and you’ll see an error.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Why am I getting this error when using Next.js middleware?
I 'm using Next.js, Prisma, and NextAuth's Email Provider strategy to setup an authentication system. I want to use Next.js middleware to ...
Read more >API Reference - Express 4.x
A new body object containing the parsed data is populated on the request object after the middleware (i.e. req.body ), or an empty...
Read more >Advanced Features: Middleware - Next.js
Middleware allows you to run code before a request is completed, then based on the incoming request, you can modify the response by...
Read more >Build Output API (v3) – Vercel Docs
The Build Output API closely maps to the Vercel product features in a ... middlewarePath. String. No. Path to an Edge Runtime function...
Read more >9 Configuring Single Sign-On in Oracle Fusion Middleware
The Oracle Access Manager Authentication Provider does not require the ... JAR are WAR files are available when you install an Oracle Fusion...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
well, for some reason after I changed the FRAMEWORK PRESET at Build & Development Settings the deploy just worked! I keep this issue open but feel free to close it if you feel the need as it is now working for me.
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.