Closed alanxp closed 6 days ago
Are you able to isolate this issue to something with next-static-utils
? I'm not very familiar with capacitor, but would like to understand your use case a bit more
Are you able to isolate this issue to something with
next-static-utils
? I'm not very familiar with capacitor, but would like to understand your use case a bit more
I believe because it is expecting to have the page 65d2cd8d..html
The use case is simply export all static html site into a webview that capacitor has to show it as an "app" for android/ios. All it needs is the static html for it to work.
I can do it with Sveltekit Static Export, but can't seem to get it with Next.JS
Are you using the useDynamicParams
hook? or getStaticParams on your pages? We don't support using getStaticParams. Not sure I can help without more information unfortunately. If you are able to share a repo / steps to reproduce I can look into it
Are you using the
useDynamicParams
hook? or getStaticParams on your pages? We don't support using getStaticParams
App Router... using useDynamicParams ofc. What capacitor does is if the link is a href="/regions/randomObjectIdHere123.html" it expects a randomObjectIdHere123.html, it could "simulate" the route next-static-fallback at least.
Ah I see. So this seems like a capacitor specific issue that is incompatible with our approach.
We generate a "fallback" page and fetch data client side. If capacitor enforces that all pages need to exist, you'll need to either
I'd recommend option 2 if possible, because in a webview pretty urls aren't as important.
going to close this issue for now, as we likely won't be able to support capacitor with our current approach--please lmk if you end up getting this resolved
As far as i know Sveltekit exports only 1 index.html and the rest of routes and pages are with javascript. So its basicly a SPA. I wonder if its possible to make a version that could change the hrefs to the fallback page so i wont get like the 404 error and fetched data thro the fallback (client side)
Got it working, however when using cpaacitor js where we use the exported "out" directory into webview, i ran into this error in xcode
[error] - Failed to fetch RSC payload for capacitor://localhost/admin/regions/65d2cd8d281b553da132e9be.