#Getting cloudflare:sockets error on pnpm run build with new blank template & new vercel postgres

6 messages · Page 1 of 1 (latest)

alpine canyon
#

I'm just spinning up a new blank template with a new vercel postgres neon db and seeing this one

Appears related to new postgres instances on vercel (neon) - not sure how to get past this. Blocking me from deploying on vercel.

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.
    at /Users/mikegill/Gill Dropbox/Mike Gill/workspaces/platform-alpha2/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/webpack/bundle5.js:29:408376
    at Hook.eval [as callAsync] (eval at create (/Users/mikegill/Gill Dropbox/Mike Gill/workspaces/platform-alpha2/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/webpack/bundle5.js:14:9224), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/mikegill/Gill Dropbox/Mike Gill/workspaces/platform-alpha2/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/webpack/bundle5.js:14:6378)
    at Object.processResource (/Users/mikegill/Gill Dropbox/Mike Gill/workspaces/platform-alpha2/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/webpack/bundle5.js:29:408301)
    at processResource (/Users/mikegill/Gill Dropbox/Mike Gill/workspaces/platform-alpha2/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/loader-runner/LoaderRunner.js:1:5308)
    at iteratePitchingLoaders (/Users/mikegill/Gill Dropbox/Mike Gill/workspaces/platform-alpha2/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/loader-runner/LoaderRunner.js:1:4667)
    at runLoaders (/Users/mikegill/Gill Dropbox/Mike Gill/workspaces/platform-alpha2/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/loader-runner/LoaderRunner.js:1:8590)
    at NormalModule._doBuild (/Users/mikegill/Gill Dropbox/Mike Gill/workspaces/platform-alpha2/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/webpack/bundle5.js:29:408163)
    at NormalModule.build (/Users/mikegill/Gill Dropbox/Mike Gill/workspaces/platform-alpha2/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/webpack/bundle5.js:29:410176)
    at /Users/mikegill/Gill Dropbox/Mike Gill/workspaces/platform-alpha2/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/webpack/bundle5.js:29:82494

Import trace for requested module:
cloudflare:sockets
./node_modules/.pnpm/[email protected]/node_modules/pg-cloudflare/dist/index.js
./node_modules/.pnpm/[email protected]/node_modules/pg/lib/stream.js
./node_modules/.pnpm/[email protected]/node_modules/pg/lib/connection.js
./node_modules/.pnpm/[email protected]/node_modules/pg/lib/index.js
./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@_2b5472e9a8b3630c6323d538804b0ab9/node_modules/@payloadcms/db-vercel-postgres/dist/connect.js
./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@_2b5472e9a8b3630c6323d538804b0ab9/node_modules/@payloadcms/db-vercel-postgres/dist/index.js
./src/payload.config.ts
./src/app/my-route/route.ts
alpine canyon
#

Workaround for now - update 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 })
nocturne cave
#

just got this error today after updating from 3.28 to 3.35.1

fathom musk
#

Same here, I use self host PostgreSQL. Just meet this issue in Docker builder