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');
}
}
![No description](https://cdn.answeroverflow.com/1233113939345281144/Screenshot_from_2024-04-25_22-54-20.png)
![No description](https://cdn.answeroverflow.com/1233114203158609961/Screenshot_from_2024-04-25_22-55-22.png)
You're missing a
default
It should be export default class ...
thanks you are a life saver