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

jazzy crashes during site building with "in `+': no implicit conversion of nil into String #171

Closed
juangamnik opened this issue Mar 1, 2015 · 16 comments · Fixed by #192
Closed
Assignees
Labels
Milestone

Comments

@juangamnik
Copy link

After some time of not regenerating the jazzy files for my project I tried it again today and got an error. So I updated to the newest version 0.1.2 and tried again. Still the same error:

building site
/Library/Ruby/Gems/2.0.0/gems/jazzy-0.1.2/lib/jazzy/sourcekitten.rb:41:in `+': no implicit conversion of nil into String (TypeError)
    from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.1.2/lib/jazzy/sourcekitten.rb:41:in `block in make_doc_urls'
    from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.1.2/lib/jazzy/sourcekitten.rb:32:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.1.2/lib/jazzy/sourcekitten.rb:32:in `make_doc_urls'
    from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.1.2/lib/jazzy/sourcekitten.rb:37:in `block in make_doc_urls'
    from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.1.2/lib/jazzy/sourcekitten.rb:32:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.1.2/lib/jazzy/sourcekitten.rb:32:in `make_doc_urls'
    from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.1.2/lib/jazzy/sourcekitten.rb:37:in `block in make_doc_urls'
    from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.1.2/lib/jazzy/sourcekitten.rb:32:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.1.2/lib/jazzy/sourcekitten.rb:32:in `make_doc_urls'
    from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.1.2/lib/jazzy/sourcekitten.rb:194:in `parse'
    from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.1.2/lib/jazzy/doc_builder.rb:108:in `build_docs_for_sourcekitten_output'
    from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.1.2/lib/jazzy/doc_builder.rb:67:in `build'
    from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.1.2/bin/jazzy:15:in `<top (required)>'
    from /usr/local/bin/jazzy:24:in `load'
    from /usr/local/bin/jazzy:24:in `<main>'

I have installed Xcode Version 6.1.1 (6A2006) and Version 6.3 (6D520o). I am using the beta version of 6.3 and the xcode-select path is set to /Applications/Xcode-beta.app/Contents/Developer. In #124 @jpsim added an output to STDERR, which swift file couldn't be parsed by sourcekitten, which helped a lot to find the problem. The comments on the issue #124 tell, that this feature has improved (not only STDERR, but direct output from the JSON parser). But unfortunately it does not output, which file is problematic. I think, because this time it is not a JSON problem but some kind of missing information that now leads to a null pointer. If I knew, which of my files is the nasty guy...

@segiddins
Copy link
Collaborator

What command did you use to run jazzy?

@juangamnik
Copy link
Author

jazzy

With nothing than that

@jpsim
Copy link
Collaborator

jpsim commented Mar 1, 2015

@juangamnik running SourceKitten directly on this project should show us where it's failing. If you send me the Xcode project that SK is failing to parse, I'll be able to troubleshoot and fix faster.

@segiddins
Copy link
Collaborator

@jpsim it's a nil USR

@jpsim
Copy link
Collaborator

jpsim commented Mar 2, 2015

@segiddins sure, but on what? I'd like to know what type I'm incorrectly assuming to always have a USR.

@juangamnik
Copy link
Author

@jpsim its a closed/private project I cannot send it. But I can execute some command on it and send you the result.

Anyways, IMO jazzy/sourcekitten should -- at any time you get aware of an error -- be enhanced with a nice error message. Otherwise it will become a support hell.

@jpsim
Copy link
Collaborator

jpsim commented Mar 2, 2015

Anyways, IMO jazzy/sourcekitten should -- at any time you get aware of an error -- be enhanced with a nice error message. Otherwise it will become a support hell.

Of course! If there was a silver bullet to never crash unexpectedly and log an error message instead, we'd do it 😉. When we find the root of this current issue, we'll be sure to a) fix it and b) add logging in the failure case. But I guarantee you, there will always be another bug ¯\_(ツ)_/¯.

@juangamnik
Copy link
Author

Of course! If there was a silver bullet to never crash unexpectedly and log an error message instead, we'd do it 😉. When we find the root of this current issue, we'll be sure to a) fix it and b) add logging in the failure case. But I guarantee you, there will always be another bug.

That's for sure and I'm aware, but still, there are some who discourage error messages for whatever reason or like it cryptic/generic, but in general this are not the users (git itself is a bad example for that in many cases). But if what you mentioned is already your policy I didn't say anything.

It's just that last time there was a JSON issue and afterwards you added an error log telling which file couldn't be parsed. Now there is somewhere in another (later?) stage a problem. Why does jazzy not tell the problematic file. This is an information you should have (nearly) always and therefore be able to log it in an error case. Please understand this as a constructive suggestion. 😉

@maplesteve
Copy link

Hi!

Having the same problem here.
I ran /Library/Ruby/Gems/2.0.0/gems/jazzy-0.1.2/lib/jazzy/sourcekitten/sourcekitten doc on the project and compared the output (it doesn't crash) with the Bicycle.json (fixture from the sourcekitten repo). The JSON doesn't have any entries for either

  • key.parsed_declaration
  • key.usr
  • key.doc.full_as_xml
  • key.annotated_decl

The other (setter_accessibility, nameoffset, kind etc.) are present.

Hope this helps.

@Ross-Gibson
Copy link

I.m having a similar issue too with /Library/Ruby/Gems/2.0.0/gems/jazzy-0.1.2/lib/jazzy/sourcekitten.rb:41:in `+': no implicit conversion of nil into String (TypeError)

Temp solution run: jazzy --skip-undocumented

@juangamnik
Copy link
Author

@Ross-Gibson same for me: --skip-undocumented works.

Hence, the nil value seems to come from an undocumented declaration. Please add an output, which declaration is responsible for that nil value. The respective information might be the breakthrough 😉.

@juangamnik
Copy link
Author

Perhaps another interesting information: with --skip-undocumented it does not throw any exceptions, but the generated docs just contain my README.MD and nothing else. As if I had no documentation at all.

@robb
Copy link

robb commented Mar 22, 2015

FWIW, I get the same error running jazzy on robb/Cartography@7419c2a.

@dcharbonnier
Copy link

+1... sounds interesting but with this problem useless...

@jpsim
Copy link
Collaborator

jpsim commented Mar 24, 2015

I pushed a fix in #192. We'll be pushing a release to rubygems in the next few days. Until then, you can run from source.

Please let me know if you're still experiencing related issues.

@juangamnik
Copy link
Author

Seems to be fixed for me (jazzy v0.2.0)

@pigeon-archive pigeon-archive modified the milestone: The Past Nov 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants