Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error loading page - The page could not be loaded due to a configuration error #227

Open
julien-mathieu opened this issue Sep 22, 2024 · 1 comment

Comments

@julien-mathieu
Copy link

Hi! Getting started with the boilerplate repository (https://github.com/hotwired/turbo-ios/tree/main/Demo), I am trying to configure a turbo-ios application to connect with rails 7. Everything works fine on most advance and replace actions, except that some links are broken in the iOS context. Those specific links work on both iPhone Safari and web browsers.

My problem seems quite similar to the one described here : #3

When the link is clicked through the simulator app, the request is sent to the web server, executed and rails returns a 200 status. However, the view from the simulator throws an error (after staying stuck on the loading screen for a few seconds). Clicking the retry button actually loads the page (cf. screenshots 1 & 2).

image image

For example, in the index page below, clicking on the main link (i.e. "MRH-L de Dora Holder") will trigger the error, but clicking on the ellipsis dropdown and on the "informations" dropdown item will load the page properly. But those two links point to the same exact URI. They alse have no "data-turbo"="false" attribute and no data-turbo-action attribute either because I want to advance (actually adding the "data-turbo-action=advance" instead of implying it doesn't work either).

The structure of this page is the following

  • each row is loaded in a turbo_frame with a src attribute pointing to the show page
  • each row contains
    • links to the show page
    • the dropdown ellipsis.
    • Clicking the ellipsis will lazy-load the menu items from a lazy-loaded turbo_frame pointing to the object show page as well.

I don't know if this structure could have an impact on my issue.

I also made sure that my JS console doesn't throw errors on those specific pages that don't load. Once again, they work fine in other contexts (web browsers, safari) and after clicking the retry button as well. It really seems like the advance redirection mechanism, and probably the configuration of my app, are causing the issue.

image image

Most links advance or replace, work fine. Only a few actually throw this error. And this will happen even if I don't change anything to the boilerplace (except the local variable in Demo.swift). But I can't figure out the pattern that will throw the error.

Any help would be greatly appreciated!
Thanks,

@julien-mathieu
Copy link
Author

These are example logs from Xcode on a failed request. I cannot figure out why does turbo cancels the visit though, and how to troubleshoot this issue?

2024-09-23 18:44:28 +0000 [Bridge] ← pageInvalidated ["timestamp": 1727117068302] [:]
2024-09-23 18:44:28 +0000 [JavascriptVisit] cancelVisit http://localhost:3000/fr/dashboard/insurance_policy/9968 [:]
2024-09-23 18:44:28 +0000 [Bridge] → window.turboNative.cancelVisitWithIdentifier [Optional("5466888a-44c7-41d6-9add-c141c8431ab8")] [:]
2024-09-23 18:44:28 +0000 [Session] visit ["location": http://localhost:3000/fr/dashboard/insurance_policy/9968, "options": Turbo.VisitOptions(action: Turbo.VisitAction.advance, response: Optional(Turbo.VisitResponse(statusCode: 200, responseHTML: Optional("  <turbo-frame data-turbo-action=\"replace\" id=\"show_insurance_policy_9968\" src=\"/fr/dashboard/insurance_policy/9968?load=true\">\n    <span class=\"d-flex align-items-center full-height d-flex justify-content-center align-items-safe-center justify-content-center\" style=\"opacity: 0.1\" data-controller=\"animated-logo\" data-animated-logo-secondary-color-value=\"#29A37A\"><canvas data-animated-logo-target=\"canvas\" class=\"animated-logo rotating\" width=\"105\" height=\"88\" style=\"height: 48px;\" /></span>\n</turbo-frame>")))), "reload": false]
2024-09-23 18:44:28 +0000 [ColdBootVisit] startVisit http://localhost:3000/fr/dashboard/insurance_policy/9968 [:]
2024-09-23 18:44:28 +0000 [Bridge] ← visitCompleted ["timestamp": 1727117068302, "identifier": 5466888a-44c7-41d6-9add-c141c8431ab8, "restorationIdentifier": 49bc7694-2680-4239-b047-e3b01e4e6775] [:]
2024-09-23 18:44:28 +0000 [Bridge] = window.turboNative.cancelVisitWithIdentifier evaluation complete [:]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant