s9tpepper
s9tpepper
CDCloudflare Developers
Created by s9tpepper on 5/16/2024 in #workers-help
Cannot file module '@cloudflare:workers'
Just created a new worker with wrangler and tried to import { WorkerEntrypoint } from '@cloudflare:workers' as shown on the docs site here: https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/#example--build-your-first-service-binding-using-rpc But I get an error from TypeScript that it can't find the module: Cannot find module '@cloudflare:workers' or its corresponding type declarations. typescript (2307) [2, 34] And I also get an error from wrangler when I try to deploy it:
Uncaught Error: Dynamic require of "cloudflare:workers" is not supported
at null.<anonymous> (worker.js:14:11)
at null.<anonymous>
Uncaught Error: Dynamic require of "cloudflare:workers" is not supported
at null.<anonymous> (worker.js:14:11)
at null.<anonymous>
Has anyone run into this issue before? I would appreciate the help, thanks!
26 replies