Skip to content
This repository was archived by the owner on Feb 8, 2026. It is now read-only.

Cloudflare Pages + experimental:nodejs_compat_v2 + fs #8

Closed
irvinebroque wants to merge 5 commits intomainfrom
bib/node-v2
Closed

Cloudflare Pages + experimental:nodejs_compat_v2 + fs #8
irvinebroque wants to merge 5 commits intomainfrom
bib/node-v2

Conversation

@irvinebroque
Copy link
Copy Markdown
Owner

@irvinebroque irvinebroque commented Jul 18, 2024

With experimental:nodejs_compat_v2, run wrangler pages deploy...

✘ [ERROR] Could not resolve "fs"

    ../build/server/index.js:6:15:
      6 │ import fs from "fs";
        ╵                ~~~~

  The package "fs" wasn't found on the file system but is built into node.
  Add the "nodejs_compat" compatibility flag to your Pages project and make sure to prefix the module name with "node:" to enable Node.js compatibility.

This error isn't right — I already have experimental:nodejs_compat_v2 enabled, but it's telling me I need to enable the nodejs_compat flag.

If I add the node: specifier to fs, I get a different error

✘ [ERROR] Deployment failed!

  Failed to publish your Function. Got error: No such compatibility flag:
  experimental:nodejs_compat_v2

But to the customer — that's what you told me in your docs I was supposed to enable :)

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Jul 18, 2024

Deploying remix-d1 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 96065cc
Status:🚫  Deploy failed.

View logs

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant