Skip to content
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

cloudflare:sockets import error #711

Closed
maxifom opened this issue Oct 25, 2023 · 4 comments
Closed

cloudflare:sockets import error #711

maxifom opened this issue Oct 25, 2023 · 4 comments

Comments

@maxifom
Copy link

maxifom commented Oct 25, 2023

I was using https://github.com/t3-oss/create-t3-turbo to create app. It uses drizzle and planetscale, i changed it to use postgres, but it gives error

ModuleBuildError: 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 /home/max/WebstormProjects/turbo-openfinance/node_modules/next/dist/compiled/webpack/bundle5.js:28:399825
    at Hook.eval [as callAsync] (eval at create (/home/max/WebstormProjects/turbo-openfinance/node_modules/next/dist/compiled/webpack/bundle5.js:13:28867), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/home/max/WebstormProjects/turbo-openfinance/node_modules/next/dist/compiled/webpack/bundle5.js:13:26021)
    at Object.processResource (/home/max/WebstormProjects/turbo-openfinance/node_modules/next/dist/compiled/webpack/bundle5.js:28:399750)
    at processResource (/home/max/WebstormProjects/turbo-openfinance/node_modules/next/dist/compiled/loader-runner/LoaderRunner.js:1:5308)
    at iteratePitchingLoaders (/home/max/WebstormProjects/turbo-openfinance/node_modules/next/dist/compiled/loader-runner/LoaderRunner.js:1:4667)
    at runLoaders (/home/max/WebstormProjects/turbo-openfinance/node_modules/next/dist/compiled/loader-runner/LoaderRunner.js:1:8590)
    at NormalModule._doBuild (/home/max/WebstormProjects/turbo-openfinance/node_modules/next/dist/compiled/webpack/bundle5.js:28:399612)
    at NormalModule.build (/home/max/WebstormProjects/turbo-openfinance/node_modules/next/dist/compiled/webpack/bundle5.js:28:401640)

because of await import ("cloudflare:sockets") in polyfilles. Any ideas how to fix it?

Github repo with steps to reproduce:
https://github.com/maxifom/postgresjs-bug

@maxifom
Copy link
Author

maxifom commented Oct 26, 2023

Similar issue brianc/node-postgres#2978

@porsager
Copy link
Owner

You should take it up with the bundler picking the wrong export.

@vincelwt
Copy link

vincelwt commented Dec 9, 2023

Also seeing this with a base Next.js 14 app in dev

@rikurainio
Copy link

same issue on Next.js 14 dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants