Dynamic Code Evaluation (e. g. 'eval', 'new Function') not allowed in Middleware pages/_middleware even if my middleware is quite simple #32532
Labels
bug
Issue was opened via the bug report template.
What version of Next.js are you using?
12.0.7
What version of Node.js are you using?
v14.16.1
What browser are you using?
Google Chrome 96.0.4664.93
What operating system are you using?
Windows
How are you deploying your application?
next start
Describe the Bug
I have this code in _middleware.ts to check URL validation using graphql.
Whenever I use "next start" it works fine, but whenever I use "next build" I get the error:
Dynamic Code Evaluation (e. g. 'eval', 'new Function') not allowed in Middleware pages/_middleware
Expected Behavior
I want to use graphql requests in middleware. What do I need to change?
To Reproduce
The text was updated successfully, but these errors were encountered: