My other site got use case like this
Form post create item, then goto item page but they are using the same route
route : /item/[itemId]
path : /item/create goto /item/123
However, with the use of paraglide-js with sveltekit adapter, the layout component is preventing this to work properly
The form action will remain on /item/create after goto /item/123, the result is I can't update the newly created product, intead it's creating new product again, which is causing duplicated new product.
Expected result :
"create" then "123" in the server log
Actual result : "create" then "123"
Affected routine
Click "Create with paraglide" in home page
Click "Create"
Click "Update"
Expected result :
"create" then "123" in the server log
Actual result : "create" then "create"
Minimal reproduction
Click "Create with paraglide" in home page
Click "goto"
Click "Update"
Expected result :
"create" then "123" in the server log
Actual result : "create" then "create"
Click F5
Click Update
Expected result : "123" in server console
Actual result : "123"
I didn't deep dive into how it's happened. And there is quick workaround by using absolute path in action.
Instead of using "?/update" we can use "{$page.url.pathname}?/update"
My other site got use case like this Form post create item, then goto item page but they are using the same route route : /item/[itemId] path : /item/create goto /item/123 However, with the use of paraglide-js with sveltekit adapter, the layout component is preventing this to work properly The form action will remain on /item/create after goto /item/123, the result is I can't update the newly created product, intead it's creating new product again, which is causing duplicated new product.
Here is the reproduction repository https://github.com/lknlknim/sveltekit-paraglide-form-actions-bug
To reproduct the issue with isolation There are 2 links at the home page "Create without paraglide" and "Create with paraglide"
Unaffected routine
Expected result : "create" then "123" in the server log Actual result : "create" then "123"
Affected routine
Expected result : "create" then "123" in the server log Actual result : "create" then "create"
Minimal reproduction
Expected result : "create" then "123" in the server log Actual result : "create" then "create"
I didn't deep dive into how it's happened. And there is quick workaround by using absolute path in action. Instead of using "?/update" we can use "{$page.url.pathname}?/update"