i did exactly 100% same as the tutorial
i did exactly 100% same as the tutorial
index.ts or where should the file storedindex.ts, im sure you are doing export default app right nowscheduled should look like this ?Please keep the discussion here friendly, if you want help.


import { Resvg, ResvgRenderOptions, initWasm } from '@resvg/resvg-wasm';
import wasmModule from '@resvg/resvg-wasm/index_bg.wasm';
export const generateImage = async (text: string) => {
console.log(text, "this is the text");
const svg = ;
try {
await initWasm(wasmModule);
} catch (error) {
console.error('Resvg wasm not initialized');
throw error;
}
const opts: ResvgRenderOptions = {
background: "white", // Optional: set background color
fitTo: {
mode: "width",
value: 600, // Adjust based on your needs
},
font: {
loadSystemFonts: true, // Disable system fonts if you're using custom fonts
},
};
const resvg = new Resvg(svg, opts);
console.log(resvg, "this is the resvg");
const pngData = resvg.render();
const pngBuffer = pngData.asPng();
return pngBuffer;
};fontBuffer is a raw ttfimport { Resvg, ResvgRenderOptions, initWasm } from '@resvg/resvg-wasm';
import wasmModule from '@resvg/resvg-wasm/index_bg.wasm';
export const generateImage = async (text: string) => {
console.log(text, "this is the text");
const svg = ;
try {
await initWasm(wasmModule);
} catch (error) {
console.error('Resvg wasm not initialized');
throw error;
}
const opts: ResvgRenderOptions = {
background: "white", // Optional: set background color
fitTo: {
mode: "width",
value: 600, // Adjust based on your needs
},
font: {
loadSystemFonts: true, // Disable system fonts if you're using custom fonts
},
};
const resvg = new Resvg(svg, opts);
console.log(resvg, "this is the resvg");
const pngData = resvg.render();
const pngBuffer = pngData.asPng();
return pngBuffer;
};font: {
fontsBuffers: [fontBuffer], //
},export default appasync scheduled(
controller: ScheduledController,
env: Env,
ctx: ExecutionContext,
) {
console.log("cron processed");
},export default {
fetch: app.fetch,
async scheduled(
controller: ScheduledController,
env: Env,
ctx: ExecutionContext
) {
....
}
}