#Cloudflare Build Error Astro related?

12 messages · Page 1 of 1 (latest)

nocturne notch
#

Hey, getting this cloudflare build error

16:06:03.214    Executing user command: bun run build
16:06:03.519    $ astro check && astro build
16:06:04.288    Error [ERR_REQUIRE_ESM]: require() of ES Module /opt/buildhome/repo/socialaize/node_modules/string-width/index.js from /opt/buildhome/repo/socialaize/node_modules/ansi-align/index.js not supported.
16:06:04.289    Instead change the require of /opt/buildhome/repo/socialaize/node_modules/string-width/index.js in /opt/buildhome/repo/socialaize/node_modules/ansi-align/index.js to a dynamic import() which is available in all CommonJS modules.
16:06:04.289        at TracingChannel.traceSync (node:diagnostics_channel:315:14)
16:06:04.289        at Object.<anonymous> (/opt/buildhome/repo/socialaize/node_modules/ansi-align/index.js:3:21) {
16:06:04.289      code: 'ERR_REQUIRE_ESM'
16:06:04.289    }
16:06:04.298    error: script "build" exited with code 1 (SIGHUP)

I've tried updating everything, reinstalling, lots of stuff. The ansi-align library comes from Astro here -->

socialaize@0.0.1 /home/zach/GitHub/socialaize/socialaize
└─┬ astro@4.14.4
  └─┬ boxen@7.1.1
    └── ansi-align@3.0.1

so not sure what to do about this

lunar slate
#

Looks like the package is not ESM compatible

#

We don't see the same issue in our tests or own projects, can you provide a minimal reproduction?

nocturne notch
#

It builds fine locally

#

but it's Cloudflare that I can't get to build, locally it's chilling

lunar slate
#

Oh the Cloudflare build pipeline might use a different node version, maybe that's the issue here

nocturne notch
lunar slate
#

In Cloudflare? And does it fix the issue?

nocturne notch
#

that's when I posted here after google didn't work

vivid cradle
#

Do you have a public repo?