lesnitsky
lesnitsky
CDCloudflare Developers
Created by lesnitsky on 5/23/2024 in #workers-help
Worker RPC host logs aren't showing up
yup, host logs aren't pushed it seems
6 replies
CDCloudflare Developers
Created by lesnitsky on 5/23/2024 in #workers-help
Worker RPC host logs aren't showing up
rpc caller:
export default {
async fetch(request: Request, env: Env) {
const result = await env.RPC_HOST.add(1, 2);
console.log(`Result: ${result}`);
return new Response(`Result: ${result}`);
},
};
export default {
async fetch(request: Request, env: Env) {
const result = await env.RPC_HOST.add(1, 2);
console.log(`Result: ${result}`);
return new Response(`Result: ${result}`);
},
};
rpc host:
import { WorkerEntrypoint } from 'cloudflare:workers';

export default class extends WorkerEntrypoint {
async fetch() {
return new Response('Hello from Worker B');
}

add(a: number, b: number): number {
console.log(`Adding ${a} and ${b}`);
return a + b;
}
}
import { WorkerEntrypoint } from 'cloudflare:workers';

export default class extends WorkerEntrypoint {
async fetch() {
return new Response('Hello from Worker B');
}

add(a: number, b: number): number {
console.log(`Adding ${a} and ${b}`);
return a + b;
}
}
I can only see "Result: 3", but expect to see "Adding 1 and 2" as well
6 replies