Skip to content

Blank template with new vercel postgres fails on pnpm run build & vercel deploy #12197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
agentgill opened this issue Apr 23, 2025 · 9 comments
Labels
status: needs-triage Possible bug which hasn't been reproduced yet

Comments

@agentgill
Copy link

Describe the Bug

Blank template with new vercel postgres fails on pnpm run build & vercel deploy

cloudflare:sockets
Module build failed: UnhandledSchemeError: Reading from "cloudflare:sockets" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "cloudflare:" URIs.

Link to the code that reproduces this issue

pnpm run build

Reproduction Steps

Create a new postgres database on vercel (v17)
Create new blank payload using pnpx create-payload-app@latest - accept defaults include vercel postgres and enter URL from new vercel neon db
Run pnpm run dev to test localhost:3000 and create first user, the database appears working
Run pnpm run build - generate error in description
Deployments on vercel - generate error in description

Which area(s) are affected? (Select all that apply)

db-vercel-postgres

Environment Info

"payload": "3.33.0"
"next": "15.3.0"
"@payloadcms/db-vercel-postgres": "3.33.0"
Node - v20.19.0
macOS - latest
@agentgill agentgill added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction Auto-added tag on create to tell bot to check recreation URL, removed after check. labels Apr 23, 2025
@agentgill
Copy link
Author

Here is workaround which appears to work for now - ignore in next config

import { withPayload } from '@payloadcms/next/withPayload'

/** @type {import('next').NextConfig} */
const nextConfig = {
  webpack: (config, { webpack }) => {
    config.plugins.push(
      new webpack.IgnorePlugin({
        resourceRegExp: /^pg-native$|^cloudflare:sockets$/,
      }),
    )
    return config
  },
}

export default withPayload(nextConfig, { devBundleServerPackages: false })

@github-actions github-actions bot removed the validate-reproduction Auto-added tag on create to tell bot to check recreation URL, removed after check. label Apr 23, 2025
Copy link
Contributor

Please add a reproduction in order for us to be able to investigate.

Depending on the quality of reproduction steps, this issue may be closed if no reproduction is provided.

Why was this issue marked with the invalid-reproduction label?

To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository created with create-payload-app@latest -t blank or a forked/branched version of this repository with tests added (more info in the reproduction-guide).

To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as minimal as possible. This means that you should remove unnecessary code, files, and dependencies that do not contribute to the issue. Ensure your reproduction does not depend on secrets, 3rd party registries, private dependencies, or any other data that cannot be made public. Avoid a reproduction including a whole monorepo (unless relevant to the issue). The easier it is to reproduce the issue, the quicker we can help.

Please test your reproduction against the latest version of Payload to make sure your issue has not already been fixed.

I added a link, why was it still marked?

Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "example.com", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links.

Useful Resources

@Quppi
Copy link
Contributor

Quppi commented Apr 24, 2025

I have the same issue with a payload project hosted on vercel and neon db after updating to the latest dependencies.

@jordanlambrecht
Copy link

Same issue running a local build with a dockerized pg server

@thatjuan
Copy link

Steps to reproduce:

pnpx create-payload-app@latest
# Choose website template
# PgSQL and provide a local valid pg url to an empty database
pnpm install
pnpm run build```

@smoothdvd
Copy link

@agentgill Lock pg-cloudflare version on 1.1.1 to solve this issue

  "peerDependencies": {
    "pg-cloudflare": "1.1.1"
  },

@asynchat
Copy link

Same issue running a local build with a dockerized pg server

me too

@SIMVIA-lucas-sovre
Copy link

same here, but the @agentgill fix worked for me

@smoothdvd
Copy link

Already fixed in 3.36.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs-triage Possible bug which hasn't been reproduced yet
Projects
None yet
Development

No branches or pull requests

7 participants