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

JavaScript error with --one-file #1426

Closed
jacob-carlborg opened this issue Jan 23, 2022 · 0 comments
Closed

JavaScript error with --one-file #1426

jacob-carlborg opened this issue Jan 23, 2022 · 0 comments
Labels

Comments

@jacob-carlborg
Copy link

When generating documentation with the --one-file flag, the generate output contains a JavaScript error.

Steps to reproduce

  1. Run the following commands:
    cat << EOF >> foo.rb
    # Foobar
    class Foo
    end
    EOF
    
    yard doc --one-file --no-save -o .
    
  2. Open the generate index.html in the browser
  3. Look at the browser console/JavaScript errors

Actual Output

I get this error, both in Safari and Chrome:

ReferenceError: Can't find variable: pathId
    postMessage - index.html:780

The error occurs in a JavaScript function called: navExpander. The issue is probably that the --one-file output does not have a navigation bar, but the JavaScript is shared with the default template, which do have a navigation bar.

Expected Output

No JavaScript errors.

Environment details:

  • OS: macOS 12.0.1
  • Ruby version (ruby -v): ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-darwin20]
  • YARD version (yard -v): yard 0.9.27
@lsegal lsegal added the Bug label Aug 26, 2024
@lsegal lsegal closed this as completed in ad2c1c4 Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants