willswire / unifi-ddns

Cloudflare DDNS (Dynamic DNS) support for UniFi OS
837 stars 2.18k forks source link

ERROR: Could not resolve "buffer" #33

Closed trentrae closed 1 year ago

trentrae commented 1 year ago

Working through this configuration for the first time / fresh setup: Ubuntu 20.04..6 Wrangler 2.17.0 nodejs v16.20.0 Cloned repo 30 Apr and ensure the updated wrangler.toml

name = "unifi-cloudflare-ddns" main = "src/index.js" compatibility_date = "2023-04-23" compatibility_flags = [ "nodejs_compat" ] azureadmin@vm-linux-001:~/unifi-cloudflare-ddns$

getting error:

✘ [ERROR] Could not resolve "buffer"

src/index.js:1:23:
  1 │ import { Buffer } from "buffer";
    ╵                        ~~~~~~~~

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

✘ [ERROR] Build failed with 1 error:

src/index.js:1:23: ERROR: Could not resolve "buffer"

willswire commented 1 year ago

Thanks for raising this issue! Checkout this branch here and let me know if it fixes your issue. 😊

trentrae commented 1 year ago

I was successful with this branch but I also had to install the buffer module. Thanks you

npm install buffer