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

Swup Error #2094

Closed
garazdawi opened this issue Mar 4, 2025 · 10 comments
Closed

Swup Error #2094

garazdawi opened this issue Mar 4, 2025 · 10 comments

Comments

@garazdawi
Copy link
Contributor

When navigating from https://erlang.org/docs/28 and clicking any of the application links (for example stdlib), sometimes swup crashes with the error below:

html-6VTPNSGQ.js:152 [swup] Container missing in incoming document: #main
(anonymous) @ html-6VTPNSGQ.js:152

Error: [swup] Container mismatch, aborting 
    at html-6VTPNSGQ.js:152:17234
    at html-6VTPNSGQ.js:152:5895
    at new Promise (<anonymous>)
    at _u (html-6VTPNSGQ.js:152:5869)
    at Bn.run (html-6VTPNSGQ.js:152:9618)
    at Bn.call (html-6VTPNSGQ.js:152:9064)
    at async Lt.Du [as renderPage] (html-6VTPNSGQ.js:152:17053)
    at async html-6VTPNSGQ.js:152:14707
    at async Bn.run (html-6VTPNSGQ.js:152:9612)
    at async Bn.call (html-6VTPNSGQ.js:152:9053)

As #2084 is not yet implemented, we are using html redirects to achieve the same thing which I assume is the reason why swup is not happy.

@josevalim
Copy link
Member

I think you can add a fake #main element, but let's fix this by implementing #2084. I will submit a pull request today. :) I will close this one on behalf of that!

@garazdawi
Copy link
Contributor Author

I just realized that we transitioned to use #1952, which is what generates pages without #main. Maybe that should also be updated to generate #main?

@josevalim
Copy link
Member

@garazdawi in theory those do not need #main, because they are not meant to go to the sidebar, but I realized that they may be linked to through markdown anyway, so we need to fix it.

@josevalim josevalim reopened this Mar 5, 2025
@josevalim
Copy link
Member

@garazdawi I have emulated your use case here and it seems to work now. Please confirm and I can release a new version!

@garazdawi
Copy link
Contributor Author

As I cannot reproduce the fault locally I deployed it here: https://garazdawi.github.io/otp/doc/readme.html

The fault as reported is fixed, but I noticed something different when navigating that is also broken.

If I click on "sasl" and then do "back" and then try to go to "sasl" again it fails, though not with any error. The page just doesn't go anywhere. This is also precent on https://erlang.org/doc/ though I did not notice it before. Your fixed changed this behaviour somewhat thoug, as now the URI reads "https://garazdawi.github.io/otp/doc/stdlib.html" instead of "https://garazdawi.github.io/otp/doc/readme.html" when I press "back".

@garazdawi
Copy link
Contributor Author

The swup progress bar also gets stuck and never completes.

@josevalim
Copy link
Member

@garazdawi it should be good now!

@josevalim
Copy link
Member

Btw, you should be able to reproduce this locally by doing erl -S httpd serve directory-with-docs/ and then accessing it via a web server.

@garazdawi
Copy link
Contributor Author

Now it works! Thanks!

@josevalim
Copy link
Member

New version is out!

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

2 participants