Skip to content

Wrangler/CF Deploy: Failed to load external module 'pg' #12735

@vanshb03

Description

@vanshb03

What versions & operating system are you using?

System:
OS: Linux 6.6 Ubuntu 24.04.3 LTS 24.04.3 LTS (Noble Numbat)
CPU: (16) x64 AMD Ryzen 7 9700X 8-Core Processor
Memory: 11.30 GB / 15.43 GB
Container: Yes
Shell: 5.2.21 - /bin/bash
Binaries:
Node: 24.13.0 - /run/user/1000/fnm_multishells/777_1772461841566/bin/node
npm: 11.10.1 - /run/user/1000/fnm_multishells/777_1772461841566/bin/npm
pnpm: 10.23.0 - /mnt/c/Users/{username}/AppData/Roaming/npm/pnpm
npmPackages:
wrangler: ^4.69.0 => 4.69.0

Please provide a link to a minimal reproduction

https://github.com/vanshb03/cf-pg-error

Describe the Bug

Unnamed error on build on Cloudflare from repo. Image attached below:

Image

While deployed from local Wrangler, visiting the site shows a "No such module" error for pg when using Hyperdrive + Supabase, despite a successful deployment via Wrangler. Also opened this on the OpenNext repo since the pg issue initially appeared to be an issue there: opennextjs/opennextjs-cloudflare#1153

Please provide any relevant error logs

https://github.com/vanshb03/cf-pg-error/blob/main/cf-pg-error.production.a56de7e2-74fb-4e3d-9bd4-c13a8adfd995.build.log

Build log for the image attached above

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions