You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading to 8.15.0, bundling with Webpack results in the following error:
Webpack compilation failed:
in 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.
changed the title [-][v8.15.0] Regression: UnhandledSchemeError when bundling with Webpack[/-][+][v8.15.0] Regression: UnhandledSchemeError "cloudflare:sockets " when bundling with Webpack[/+]on May 1, 2025
changed the title [-][v8.15.0] Regression: UnhandledSchemeError "cloudflare:sockets " when bundling with Webpack[/-][+][v8.15.0] Regression: UnhandledSchemeError "cloudflare:sockets" when bundling with Webpack[/+]on May 1, 2025
hmmm thanks for the info! Any idea on the right fix here? I wonder if I should write a test by trying to webpackify everything in a separate module in the repo & see if it works?
And users of Cloudflare Workers need to explicitly enable the conditions in their webpack configs.
Or another option might be move (to dev)/remove the dependency pg-cloudflare, and users need to explicitly add it as a dependency in their package.json.
Also having the same regession with vite. The last working resolved version is pg-cloudflare@1.1.1. Any version after this breaks my build. I also cant figure out how to force pnpm to resolve to this version for pg package dependencies. I have to manually go into my pnpm-lock.yaml file and revert back to the 1.1.1 resolution any time I make dependency updates.
Also having the same regession with vite. The last working resolved version is pg-cloudflare@1.1.1. Any version after this breaks my build. I also cant figure out how to force pnpm to resolve to this version for pg package dependencies. I have to manually go into my pnpm-lock.yaml file and revert back to the 1.1.1 resolution any time I make dependency updates.
I was struggling with this for a bit today as well. It seems pnpm overrides dependencies at the root level in a monorepo (makes sense, I guess) and overrides needs to be specified differently. Both of the following worked for me:
In pnpm-workspace.yaml: overrides: pg-cloudflare: 1.1.1
and in root package.json: "pnpm": { "overrides": { "pg-cloudflare": "1.1.1" } },
While waiting for #3482, if you need a temporary workaround to allow/ignore cloudflare:sockets for webpack/vite/rollup instead of reverting pg-cloudflare to 1.1.1, please check the tests or README in #3482.
Basically the configs to handle cloudflare:sockets would be needed whenever pg-cloudflare is enabled while using some bundlers. Right now pg-cloudflare is enabled by default, and after #3482 it will be enabled through resolve conditions.
Activity
[-][v8.15.0] Regression: UnhandledSchemeError when bundling with Webpack[/-][+][v8.15.0] Regression: UnhandledSchemeError "cloudflare:sockets " when bundling with Webpack[/+][-][v8.15.0] Regression: UnhandledSchemeError "cloudflare:sockets " when bundling with Webpack[/-][+][v8.15.0] Regression: UnhandledSchemeError "cloudflare:sockets" when bundling with Webpack[/+]CHC383 commentedon May 1, 2025
As noted in #2978, the temporary workarounds would be:
webpack.config.js
next.config.ts
brianc commentedon May 1, 2025
hmmm thanks for the info! Any idea on the right fix here? I wonder if I should write a test by trying to webpackify everything in a separate module in the repo & see if it works?
CHC383 commentedon May 2, 2025
@brianc If you are okay with the conditional exports as the previous version, how about using nested conditions? Something like:
And users of Cloudflare Workers need to explicitly enable the conditions in their webpack configs.
Or another option might be move (to dev)/remove the dependency
pg-cloudflare
, and users need to explicitly add it as a dependency in theirpackage.json
.cjnoname commentedon May 10, 2025
We're experiencing the same issue. Is there a better solution for this?
willr42 commentedon May 11, 2025
Also experiencing this. Is there a workaround for Vite?
ghardin1314 commentedon May 13, 2025
Also having the same regession with vite. The last working resolved version is
pg-cloudflare@1.1.1
. Any version after this breaks my build. I also cant figure out how to force pnpm to resolve to this version forpg
package dependencies. I have to manually go into mypnpm-lock.yaml
file and revert back to the1.1.1
resolution any time I make dependency updates.brianc commentedon May 13, 2025
I'm open to a PR to fix this....particularly if there's a test included to reproduce it, though that's not required.
Rollup failed to resolve import "cloudflare:sockets"
when building with vite #3469Rollup failed to resolve import "cloudflare:sockets"
when building with vite #3469 as a duplicate of this issuejosuazurbruegg commentedon Jun 1, 2025
I was struggling with this for a bit today as well. It seems pnpm overrides dependencies at the root level in a monorepo (makes sense, I guess) and overrides needs to be specified differently. Both of the following worked for me:
In pnpm-workspace.yaml:
overrides: pg-cloudflare: 1.1.1
and in root package.json:
"pnpm": { "overrides": { "pg-cloudflare": "1.1.1" } },
CHC383 commentedon Jun 4, 2025
While waiting for #3482, if you need a temporary workaround to allow/ignore
cloudflare:sockets
forwebpack
/vite
/rollup
instead of reverting pg-cloudflare to1.1.1
, please check the tests or README in #3482.Basically the configs to handle
cloudflare:sockets
would be needed wheneverpg-cloudflare
is enabled while using some bundlers. Right nowpg-cloudflare
is enabled by default, and after #3482 it will be enabled through resolve conditions.