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
Do you have a Worker snippet to reproduce it?
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');
}
}
You're missing a
default
It should be export default class ...
thanks you are a life saver