Skip to content

Why not use Node.js Packages in MiddleWare? #34790

Discussion options

You must be logged in to vote

Hello.

Middlewares are run by the Next.js Edge Runtime which is based on standard Web APIs.

As stated by the documentation:
https://nextjs.org/docs/api-reference/edge-runtime#unsupported-apis

Native Node.js APIs are not supported. For example, you can't read or write to the filesystem

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@CheaterScript
Comment options

@rake7h
Comment options

Answer selected by CheaterScript
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants