Error when running in latest Next.js version with middleware
See original GitHub issueOn Next.js v12, you’ll get this when adding middleware to your app:
`eval` not allowed in Middleware pages/_middleware
error - node_modules/@builder.io/sdk/dist/index.esm.js?b22a (919:0) @ <unknown>
TypeError: Cannot read property 'parse' of null
This points to this line which makes use of serverOnlyRequire
. The problem is that that function makes use of eval
to detect require
and since Next.js doesn’t allow eval
in middleware it’ll throw no matter what so I think another non-eval check is needed.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Advanced Features: Error Handling - Next.js
Handle errors in your Next.js app. ... It is only visible when the development server runs using next dev , npm run dev...
Read more >Unable to use the middleware feature with React 18 & output ...
To complete my issue, if I use the export const config in the middleware file, I get only the error 500 mentioned upper...
Read more >Why am I getting this error when using Next.js middleware?
js . Next. js creates a sandbox for the middleware by removing properties of process , while some libraries require it.
Read more >Next.js Middleware is out of beta - YouTube
Next. js middleware is out of beta and in this video we will go through the breaking changes that you need to be...
Read more >next-connect - npm
The method routing and middleware layer for Next.js (and many others). Latest version: 0.13.0, last published: 5 months ago. Start using ...
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
Running a hydrogen storefront using vercel’s edge functions
This is fixed and released in the latest stable version please use
@builder.io/react@2.0.5
to get the fix, thank you for reporting