Dynamic require of "cloudflare:workers" is not supported please help

Trying to implment RPC --> here is my wrangler --> compatibility_date = "2024-04-19" compatibility_flags = ["nodejs_compat"]
6 Replies
kian
kian7mo ago
Do you have a Worker snippet to reproduce it?
Sohaib Muhammad
Sohaib MuhammadOP7mo ago
import { WorkerEntrypoint } from 'cloudflare:workers'; interface Env { AMAD_LOGIN_SCRAP_BKT: any; // R2 bucket } export class AuthService extends WorkerEntrypoint<Env> { async sendSomeData() { return { someKey: 'some value' }; } async fetch() { return new Response('ok'); } }
Sohaib Muhammad
Sohaib MuhammadOP7mo ago
No description
Sohaib Muhammad
Sohaib MuhammadOP7mo ago
No description
kian
kian7mo ago
You're missing a default It should be export default class ...
Sohaib Muhammad
Sohaib MuhammadOP7mo ago
thanks you are a life saver
Want results from more Discord servers?
Add your server