the reason I want to do it with workers is because I don't want any site data/load to be sent before
the reason I want to do it with workers is because I don't want any site data/load to be sent before the user is verified
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?wrangler reads your config when using Pageswrangler dev, so it unintentionally reads the config, even though it shouldn'tshim.mjs shouldn't be in the output directory at all. Maybe try moving it somewhere else?resolve/build/worker/shim.mjs/functions/_worker.js&& mvwrangler2 pages devcommand = "( cd backend && cargo install -q worker-build && worker-build --release ) && ( cd frontend && yarn run build )"wrangler2 pages dev frontend/distfrontend/distsleep 60&& sleep 60wranglershim.mjs