Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Having trouble using Payload CMS 3 with Next.js middleware (Node Error)

default discord avatar
m7medVision9 months ago
1 1

Hi everyone,

I'm trying to use payload cms 3.0 with middleware.ts to do check user auth, but I'm encountering a Node error during the build process. Here's the error message:

Module build failed: UnhandledSchemeError: Reading from "node:os" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.

I'm not very familiar with this error. Has anyone else faced this when using Payload CMS with middleware in Next.js? Any guidance on how to fix it or what plugin might be needed would be greatly appreciated!

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.