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

Content rendering error in MDN (HTML, JS, CSS) docsets #1155

Closed
dania-prog opened this issue Nov 8, 2019 · 66 comments · Fixed by #1125
Closed

Content rendering error in MDN (HTML, JS, CSS) docsets #1155

dania-prog opened this issue Nov 8, 2019 · 66 comments · Fixed by #1125

Comments

@dania-prog
Copy link

After updating to zeal 0.6.1, the content could not be displayed in the Tabs. Pasted below is the display error.
image
kindly assist to resolve. Thanks

@sanruby
Copy link

sanruby commented Nov 8, 2019

error same as , the javascript docset

@mansur-r
Copy link

mansur-r commented Nov 8, 2019

Same error, using just an initial html docset

@antoni-minkiewicz
Copy link

Same error

@falegh
Copy link

falegh commented Nov 10, 2019

Zeal 0.6.0, Ubuntu 18.04

Content rendering error after installing updates to these docsets:

  • CSS
  • HTML
  • JavaScript
  • SVG

React, Bash and some others working fine

@dania-prog
Copy link
Author

The following docsets has the error (content rendering error) after installing updates to the docsets:

  • CSS
  • HTML
  • JS
  • Java SE11 (the application closes out)
  • Java SE9 (the application closes out)
  • Perl
  • RubyMotion
  • SVG
  • WordPress
    The rest are functional. Kindly lets know when it has been resolved.

@trollixx
Copy link
Member

Docsets produced from MDN (HTML, CSS, JS, SVG) are broken because of the new JS functionality. It appears to be fixed by the mdn/kuma#5996. Unfortunately, WebKit (and also Firefox) can't load polyfills over the file: scheme. I'm looking into possible solutions.

@dania-prog I cannot reproduce crashes with the Java docsets. Is it possible that you are affected by #868?

Perl and RubyMotion docsets didn't have index page set, should be fixed now. Refresh the docset list, and reinstall the docsets.

The WordPress docset has incorrect dashIndexFilePath in Info.plist, no_index_test/index.html doesn't exist. @Kapeli can you take a look? I think the property is redundant because index.html is present.

@Kapeli
Copy link
Contributor

Kapeli commented Nov 11, 2019

I sometimes set the dashIndexFilePath to inexistent pages to make Dash not show an index for the docset anymore. In a future version of Dash index pages won't be as important anymore, so some docsets won't have them anymore.

@zjffun
Copy link

zjffun commented Nov 12, 2019

I find it can fix temporary by remove the
CSS.docset\Contents\Resources\Documents\developer.mozilla.org\static\build\js\react-main.ddbbd86b0685.js.

@prurigro
Copy link

Nice fix zjiffun-- here's the same solution turned into a little function you can add to your .bashrc that'll fix all the docs with that problem:

zeal-docs-fix() {
    pushd "$HOME/.local/share/Zeal/Zeal/docsets" >/dev/null || return
    find . -iname 'react-main*.js' -exec rm '{}' \;
    popd >/dev/null || exit
}

@trollixx
Copy link
Member

I sometimes set the dashIndexFilePath to inexistent pages to make Dash not show an index for the docset anymore. In a future version of Dash index pages won't be as important anymore, so some docsets won't have them anymore.

@Kapeli what does Dash show in such scenario?

@Kapeli
Copy link
Contributor

Kapeli commented Nov 15, 2019

The current version of Dash shows a home page that looks like this:

Screenshot 2019-11-15 at 06 33 35

@trollixx
Copy link
Member

trollixx commented Nov 15, 2019

So Dash simply displays its own home page instead of docset's index page?

@Kapeli
Copy link
Contributor

Kapeli commented Nov 15, 2019

Yes, but only when there's no docset index page. Otherwise, it shows the index page.

Future version of Dash will have a "Show index page" option which the user will have to press specifically (something like how it works on Dash for iOS). For docsets without an index page, I won't show that option.

@trollixx
Copy link
Member

Unfortunately, serving MDN docset from a local HTTP server doesn't help. I think even with the polyfills Qt WebKit is just too old, while for example Firefox began to render properly.

Reported Qt WebKit problem in qtwebkit/qtwebkit#922.

Considering the amount of issues with Qt WebKit, at this point it seems like attempting another migration to Qt WebEngine. There is also a pending PR.

@stompy-chum
Copy link

@trollixx: Chrome and Chromium have a command-line flag to enable local file serving, in case that's useful:

chrome.exe --allow-file-access-from-files

I use this to test HTML Imports locally, for example.

@swedishpotato
Copy link

Is there any view yet on when this might be fixed? We love Zeal and depend on it for serving docsets in a completely offline teaching environment, but since the last docset updates we've lost HTML, CSS, JS etc docsets. Is there any way of getting the old docsets back in the meantime so that we at least have something we can use?

@madand
Copy link

madand commented Dec 8, 2019

@swedishpotato if you have access to any Unix-like OS with Shell (GNU/Linux, MacOSX, *BSD), see #1155 (comment) for easy fix of the docsets.

If you only have Windows, you can manually clean-up the relevant docsets by deleting the offending JS file from each docset's folder:

  • JavaScript.docset\Contents\Resources\Documents\developer.mozilla.org\static\build\js\react-main.e49be9481ede.js
  • CSS.docset\Contents\Resources\Documents\developer.mozilla.org\static\build\js\react-main.e49be9481ede.js
  • HTML.docset\Contents\Resources\Documents\developer.mozilla.org\static\build\js\react-main.e49be9481ede.js

The exact JS filename may differ in that e49be9481ede bit, just look for react-main.<something>.js and delete it.

@jimmylab
Copy link

jimmylab commented Dec 9, 2019

@swedishpotato if you have access to any Unix-like OS with Shell (GNU/Linux, MacOSX, *BSD), see #1155 (comment) for easy fix of the docsets.

If you only have Windows, you can manually clean-up the relevant docsets by deleting the offending JS file from each docset's folder:

  • JavaScript.docset\Contents\Resources\Documents\developer.mozilla.org\static\build\js\react-main.e49be9481ede.js
  • CSS.docset\Contents\Resources\Documents\developer.mozilla.org\static\build\js\react-main.e49be9481ede.js
  • HTML.docset\Contents\Resources\Documents\developer.mozilla.org\static\build\js\react-main.e49be9481ede.js

The exact JS filename may differ in that e49be9481ede bit, just look for react-main.<something>.js and delete it.

Much thanks for your tips!

Here is my batch version:

:: set you own doc path
set DOCPATH=C:\ZealDocs

set CORRUPT_FILE=Contents\Resources\Documents\developer.mozilla.org\static\build\js\react-main.*.js
ren "%DOCPATH%\JavaScript.docset\%CORRUPT_FILE%" *.js.bak
ren "%DOCPATH%\CSS.docset\%CORRUPT_FILE%" *.js.bak
ren "%DOCPATH%\HTML.docset\%CORRUPT_FILE%" *.js.bak
ren "%DOCPATH%\SVG.docset\%CORRUPT_FILE%" *.js.bak
pause

@tonnysi
Copy link

tonnysi commented Dec 13, 2019

Only add slash before %CORRUPT_FILE%

set DOCPATH=C:\ZealDocs
 
set CORRUPT_FILE=Contents\Resources\Documents\developer.mozilla.org\static\build\js\react-main.*.js
ren "%DOCPATH%\JavaScript.docset\%CORRUPT_FILE%" *.js.bak
ren "%DOCPATH%\CSS.docset\%CORRUPT_FILE%" *.js.bak
ren "%DOCPATH%\HTML.docset\%CORRUPT_FILE%" *.js.bak
ren "%DOCPATH%\SVG.docset\%CORRUPT_FILE%" *.js.bak
pause

@anibalsanchez
Copy link

A small tweak:

find ~/.local/share/Zeal/Zeal/docsets -name "react-main.*.js" -exec rm --interactive {} \;

@kohane27
Copy link

@anibalsanchez Building on top:

If you're on Windows, has Git for Windows, using the default docset storage directory (C:\Users\UserName\AppData\Local\Zeal\Zeal\docsets), then run this script:

find ~/AppData/Local/Zeal/Zeal/docsets -name "react-main.*.js" -exec rm --interactive {} \;

Press Enter a few times to confirm the deletions.

@dblandin
Copy link

It took a bit of hunting to find where docsets are installed for a Flatpak-installed setup :

~/.var/app/org.zealdocs.Zeal/data/Zeal/Zeal/docsets

Here's an invocation building off of other comments to clean out these problematic JavaScript files within the docsets:

$ find .var/app/org.zealdocs.Zeal/data/Zeal/Zeal/docsets -name "react-main.*.js" -exec rm {} \;

source: https://docs.flatpak.org/en/latest/sandbox-permissions.html

@J3RN
Copy link

J3RN commented Jul 28, 2020

Now that this issue is resolved, would it be possible to cut a new release? I'm assuming the package maintainers for the assorted Linux distros (and Flatpak) are watching for a new tagged version to be released before packaging and distributing it.

@2bit-hack
Copy link

#1155 (comment) fixed the rendering issue and displays the front page for the JavaScript docset, but whenever I click on any of the other links, I get a QtNetworkError 203.

The exact error is as follows:
Error opening /home/sierrakilo/.local/share/Zeal/Zeal/docsets/JavaScript.docset/Contents/Resources/Documents/developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval.html: No such file or directory

This is because the path that was created on my device was .../Global_objects/... instead of .../Global_Objects/.... I fixed it by manually changing the directory name, but it would be nice if this was changed automatically.

I'm using Manjaro Linux KDE, and installed Zeal using pacman. Also, I can confirm this happened only for the JavaScript docset and not the HTML and CSS docsets.

@Zaggar
Copy link

Zaggar commented Sep 30, 2020

If you are using Windows, i think this is more straight forward.

https://www.programmersought.com/article/89484147811/

@lesar
Copy link

lesar commented Oct 2, 2020

same problem running on Ubuntu 20.04 64bit desktop on rpi4

way the issue is closed if the problem persist?

@Zaggar
Copy link

Zaggar commented Oct 2, 2020

Then you will have to do same (delete the react-mainxxxxxx.js files) for both HTML.docset and JavaScript.docset

@iootaa iootaa mentioned this issue Oct 10, 2020
@sgrubsmyon
Copy link

same problem running on Ubuntu 20.04 64bit desktop on rpi4

way the issue is closed if the problem persist?

Because, as @trollixx commented on May 5, the issue has been fixed by the port to Qt WebEngine. It just has not been released yet and will enter release v0.7.0. Until that is out, you need to either compile Zeal yourself, try the CI builds or apply the workaround.

@akx
Copy link

akx commented Nov 3, 2020

On Windows, you can use del /s (making it recursive), e.g.

C:\Users\yourusername\AppData\Local\Zeal\Zeal\docsets>del /s/q react-main*js

to find and eradicate the react-main.js files.

@ulag-byte
Copy link

have the same problem with zeal 0.6.1, I cant see javascript, html, css

@marui888
Copy link

I find it can fix temporary by remove the
CSS.docset\Contents\Resources\Documents\developer.mozilla.org\static\build\js\react-main.ddbbd86b0685.js.
It works, really

@thefonso
Copy link

This is broken again. Javascript, css, html docset from mdn are all dark. all other docsets display fine.

@trollixx trollixx unpinned this issue Sep 27, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Nov 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.