Yes to number one, don’t have any Functions on the route for number two
Yes to number one, don’t have any Functions on the route for number two
_worker.js that just reexports your Worker. wrangler should autobundle for you anywaytsc at all_worker.js bundling, so you could keep the same structure, and just have _worker.js be resolve, return an error instead._routes.json generation in Astro's cloudflare adapter /build/worker/shim.mjs file, instead of the expected /functions/_worker.js.&& mv it in my build commandwrangler2 pages devwrangler2 pages dev frontend/dist, I get an error:✘ [ERROR] Could not validate _routes.json at /home/jeroen/project/frontend/dist: Error: ENOENT: no such file or directory, open '/home/jeroen/project/frontend/dist/_routes.json'
✘ [ERROR] 1 error(s) and 0 warning(s) when compiling Worker.
▲ [WARNING] Failed to bundle _worker.js. Error: Build failed with 1 error:
../../.wrangler/tmp/bundle-sGxLQ0/middleware-insertion-facade.js:1:43: ERROR: Could not resolve
"/home/jeroen/project/frontend/dist/_worker.js"
at failureErrorWithLog
(/usr/lib/node_modules/wrangler/node_modules/esbuild/lib/main.js:1636:15)
at /usr/lib/node_modules/wrangler/node_modules/esbuild/lib/main.js:1048:25
at /usr/lib/node_modules/wrangler/node_modules/esbuild/lib/main.js:1512:9
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
errors: [
{
detail: undefined,
id: '',
location: [Object],
notes: [],
pluginName: '',
text: 'Could not resolve
"/home/jeroen/project/frontend/dist/_worker.js"'
}
],
warnings: []
}Compiled Worker successfully
frontend/dist directory, my worker will not work. It won't even be detected. So CloudFlare seems to insist my worker already exists before the build command is ran, and then compiles it while the build command runs.sleep 60, at no point does CloudFlare try to build the worker until the sleep is over. However, if I add a && sleep 60 to my build command, cloudflare will try to build my worker before the sleep has even started.wrangler.toml?tschandleresolve_routes.json/build/worker/shim.mjs/functions/_worker.jsimport worker from "../src";
export default worker;