Open uioporqwerty opened 2 months ago
I tried out some of the suggestions here as well in a fresh repo: https://github.com/geoffrich/svelte-adapter-azure-swa/issues/96
But if you do the following config:
{
"configurations": {
"app": {
"outputLocation": "./build/static",
"apiLocation": "./build/server",
"run": "npx vite dev",
"swaConfigLocation": "./build",
"appDevserverUrl": "http://localhost:5173"
}
}
}
Then the form submission works great but you lose HMR after the initial POST as you're left with the errors described above where _app assets don't resolve correctly. Is there another change needed in the proxy vite plugin to support routing to _app while keeping hot reloading working?
Hello! Can you provide a self-contained repo reproducing the issue?
It's worth noting that the SWA CLI isn't fully supported with this adapter - that's what #96 is tracking.
So I know we build with
swa build
and it will create abuild
folder by default. In thisbuild
folder you can find a compiledstaticwebapp.config.json
which is good. However, if I use aswa-cli.config.json
as specified below, then I get a bunch of errors about mime types not resolving and entire files being missing.swa-cli.config.json
I run local development with
swa build && swa start
. Is this the correct way to support SWA CLI? I'm trying to resolve an issue where if I don't specify theswaConfigLocation
then I have to maintain astaticwebapp.config.json
in the root of my repo just for local development. This leads to duplicate config entries betweenstaticwebapp.config.json
andsvelte.config.js
and if I commit this to my repo then the entire app stops serving in Azure. Trying to determine what the proper setup looks like for development purposes between this and SWA CLI.This is just one of the issues I'm encountering unfortunately. For some reason my form POST actions are returning a 405 Method Not Allowed when I run via the SWA CLI and I'm not sure why that's happening but it led me to try and fix my local development configuration. The same form submission I do against http://localhost:5173 will succeed, but proxied through swa cli, it won't and result in 405 method not allowed :/