pages_build_output_dir ignored in monorepo

Just switched to a monorepo to add a durable object to my web app (DO's in pages would be awesome). i've tried both options from the first image in my wrangler.toml pages_build_output_dir . both options lead to the error in the second image, my setting is being ignored. the web dashboard says I cannot change it there - must only be changed through the toml file. my pages app is in apps/pages/ with the wrangler.toml here. i've tried changing root directory and it breaks my monorepo (cant import other packages) so it is blank what am i doing wrong? thankyou!
No description
No description
No description
7 Replies
ickerio
ickerioOP6mo ago
i'll add as well i can run the build command locally no issues and it builds to apps/pages/.svelte-kit/cloudflare as expected Hi, anyone have any idea what I might be doing wrong?
jason
jason5mo ago
I have a similar issue. Did you get this sorted? My SvelteKit app lives in web , but the build fails if I keep wrangler.toml in web, b/c the build looks for wrangler.toml in the root (unsuccessfully as expected), before it changes into `web.
No description
jason
jason5mo ago
Doesn't make sense to put wrangler.toml in the root when it only applies to web imo. @ickerio For you, click advanced on build settings and try specifying the subdirectory in which your SvelteKit app lives within your monorepo. Like web for me. Did you end up putting wrangler.toml in the root?
ickerio
ickerioOP5mo ago
I haven’t resolved this issue yet unfortunately If I I change the root directory then it breaks my bun workspace and I can’t import my other packages did you ever find a fix?
jason
jason5mo ago
I moved wrangler.toml into my root instead of keeping it in web, and I used the build configuration in my screenshot above. That's all that I recall. Working for me now, but I'm not using bun workspaces Oh, I commented out the build dir in wrangler.toml, because it was causing an issue: # pages_build_output_dir = "web/.svelte-kit/cloudflare" I'm honestly confused what my wrangler.toml is even doing, maybe nothing, because this is an existing Pages project and thought I read it only applies to new Pages projects
ickerio
ickerioOP5mo ago
Just an update in case anyone ever finds this thread. I fixed it by adding a copy directory to my build command cd apps/pages && bun run build && cp -r .svelte-kit ../../.svelte-kit Stupid fix but 🤷‍♂️
jason
jason4mo ago
Interesting. I didn’t need to do that, but might have it set up slightly differently. I have noticed that I get “unexpected pages_build_output_dir…” (iirc) or “missing pages_build_output_dir…” warnings about wrangler.toml and find myself commenting or uncommenting that line at various times to make it work for various commands. Which is also 🤷🏼‍♂️haha
Want results from more Discord servers?
Add your server