Pages site failed to deploy (publish) due to node:crypto and node:buffer

For Workers & Pages, what is the name of the domain?

hubkhekhelicom

What is the error message?

Error: Failed to publish your Function. Got error: Uncaught Error: No such module “node:crypto”.

What is the issue or error you’re encountering

I recently added node:crypto and node:buffer to my Pages site. As the docs says I added node-compact flag to my wrangler.json file, as a result my site was able to build successfully but it failed to deploy (publish).

What steps have you taken to resolve the issue?

  1. Added node-compact to wrangler.json file (the build log shows the build was able to use it)
  2. Make sure my Compatibility date was set to Apr 8, 2025

It should be nodejs_compat, not compact. Can you post the content of your wrangler.json?