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
kian2mo ago
Do you have a Worker snippet to reproduce it?
Sohaib Muhammad
Sohaib Muhammad2mo 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 Muhammad2mo ago
No description
Sohaib Muhammad
Sohaib Muhammad2mo ago
No description
kian
kian2mo ago
You're missing a default It should be export default class ...
Sohaib Muhammad
Sohaib Muhammad2mo ago
thanks you are a life saver