You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This doesn't work for multipage app routing like nextjs. Even turning on nextjs's trailingSlash option won't fix it because it always returns the root index.html, not the index.html of the path.
The solution would seem to be a series of attempts to find the file, and if it's missing fallback to the SPA handling.
The order should probably be:
Iff the path is missing an html extension:
Is there a file that exists at the path? Return it
Is there a file that exists at that path with a .html extension? return it
Is there a file that exists at that path when /index.html is appended? return it
Fall back to the root /index.html (to handle SPAs)
Looks like the only reason this is a problem is that [email protected] is doing MPA navigations rather than SPA navigations. It's probably a next bug because 14.1 is doing SPA navigations correctly.
However this issue is probably still valid - i'd expect /folder/ links to open /folder/index.html
Capacitor Version
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 7.0.1
@capacitor/core: 7.0.1
@capacitor/android: 7.0.1
@capacitor/ios: 7.0.1
Installed Dependencies:
@capacitor/android: not installed
@capacitor/cli: 7.0.1
@capacitor/core: 7.0.1
@capacitor/ios: 7.0.1
Other API Details
Platforms Affected
Current Behavior
When attempt to navigate to a url that matches a file but does not include the file's extension then the content of the
index.html
is returned.index.html
with awindow.location
:capacitor://localhost
./another-page
(Notice the missing.html
extension)capacitor://localhost/another-page
but the response body is the content ofindex.html
Expected Behavior
When the app loads
capacitor://localhost/another-page
the response body should be the content ofanother-page.html
Project Reproduction
https://github.com/richard-jfc/capacitor-url-bug
Additional Information
No response
The text was updated successfully, but these errors were encountered: