Error building pages Module build failed: UnhandledSchemeError: Reading from "node:crypto"

Hi team,
I´m trying to move my NextJs app from Vercel to Pages and i´m getting several errors when building my application:

Failed to compile.
12:58:58.301 node:crypto
12:58:58.302 ▲ Module build failed: UnhandledSchemeError: Reading from "node:crypto" is not handled by plugins (Unhandled scheme).
12:58:58.302 ▲ Webpack supports "data:" and "file:" URIs by default.
12:58:58.302 ▲ You may need an additional plugin to handle "node:" URIs.

...


12:58:58.304 node:fs/promises
12:58:58.305 ▲ Module build failed: UnhandledSchemeError: Reading from "node:fs/promises" is not handled by plugins (Unhandled scheme).
12:58:58.305 ▲ Webpack supports "data:" and "file:" URIs by default.
12:58:58.305 ▲ You may need an additional plugin to handle "node:" URIs.

And several more.

It seems it is related to using formidable (https://github.com/node-formidable/formidable). Is there anything I should change somewhere to make it work?
I use formidable in some functions in the pages/api folder to read the form content.

Thanks!
Was this page helpful?