OpusVL / perldoc.perl.org

perldoc.perl.org website
26 stars 10 forks source link

Can't search from https://perldoc.perl.org/perl.html (or other pages with no '/' in the path) #111

Closed cxw42 closed 4 years ago

cxw42 commented 4 years ago

Bug

Environment: Chrome 79 x64, Win7 x64. I tried this in both a normal window and an incognito window.

Steps:

Expected: Search results for sprintf

Observed: The page does nothing

Explanation

The browser console shows this on page load:

main.min.js:3 GET https://perldoc.perl.org/perlintro.html/search.json 404
    (anonymous) @ main.min.js:3
    Promise.then (async)
    (anonymous) @ main.min.js:3
main.min.js:3 Uncaught (in promise) SyntaxError: Unexpected end of JSON input
    at main.min.js:3

It looks like main.js can't handle pages that don't have two levels of indirection. E.g.,

https://perldoc.perl.org/5.30.0/perl.html   <-- works - requests /search.json
https://perldoc.perl.org/perl.html          <-- doesn't work - requests /perl.html/search.json 

Thanks in advance for fixing this!

Grinnz commented 4 years ago

Related to #74

cxw42 commented 4 years ago

Ah - sorry! Yes, this is a duplicate of #74. However, PR OpusVL/perldoc.perl.org-engine#13 is now open :D .