compatibility_flags = [ "nodejs_compat" ] not working

I get this message even after adding this flag to the wrangler.toml file

The package "http" wasn't found on the file system but is built into node.
Add "node_compat = true" to your wrangler.toml file to enable Node.js compatibility.


even when using different compatibility dates, currently with compatibility_date = "2023-08-15"

I have also tried the legacy node_compat = true flag instead of the new compatibility_flags = [ "nodejs_compat" ] setting.

Also tried running it with both and it gets mad.

Also tried installing the packages manually and it keeps erroring out.

Is there anything I'm doing wrong with this flag? How am I supposed to use it exactly?


This is all caused by trying to include the googleapis package that has http2 (its the one thing that crashes with the legacy flag.
With the new flag about 50 things show the "Add "node_compat = true" " flag
Was this page helpful?