SassDoc / sassdoc

Release the docs!
http://sassdoc.com
MIT License
1.41k stars 56 forks source link

SASS files correctly parsed but the documentation is not generated #557

Open lperamo opened 3 years ago

lperamo commented 3 years ago

As I said in the title and you can see it in the following report, the SASS files are correctly parsed but there is no documentation. The folder sassdoc was created but it remains empty. Here is my SASS version, in case it is useful 1.27.0 compiled with dart2js 2.10.1. Do not hesitate to ask for more information. My code is not open sourced yet.

lionel-Predator-GX-792:components (feature/SASSDoc*) $ sassdoc bundles/Ecocomposer --verbose
» Folder `bundles/Ecocomposer` successfully parsed.
» Folder `sassdoc` successfully refreshed.
» [ERROR] Template render error: (/usr/local/lib/node_modules/sassdoc/node_modules/sassdoc-theme-default/views/documentation/index.html.njk)
  Template render error: (/usr/local/lib/node_modules/sassdoc/node_modules/sassdoc-theme-default/views/includes/partials/item.html.njk)
  Template render error: (/usr/local/lib/node_modules/sassdoc/node_modules/sassdoc-theme-default/views/includes/annotations/parameter.html.njk)
  TypeError: Cannot read property 'split' of undefined
    at Object._prettifyError (/usr/local/lib/node_modules/sassdoc/node_modules/nunjucks/src/lib.js:36:11)
    at /usr/local/lib/node_modules/sassdoc/node_modules/nunjucks/src/environment.js:561:19
    at eval (eval at _compile (/usr/local/lib/node_modules/sassdoc/node_modules/nunjucks/src/environment.js:631:18), <anonymous>:119:12)
    at eval (eval at _compile (/usr/local/lib/node_modules/sassdoc/node_modules/nunjucks/src/environment.js:631:18), <anonymous>:384:12)
    at /usr/local/lib/node_modules/sassdoc/node_modules/nunjucks/src/environment.js:569:11
    at eval (eval at _compile (/usr/local/lib/node_modules/sassdoc/node_modules/nunjucks/src/environment.js:631:18), <anonymous>:120:12)
    at /usr/local/lib/node_modules/sassdoc/node_modules/nunjucks/src/environment.js:569:11
    at Template.root [as rootRenderFunc] (eval at _compile (/usr/local/lib/node_modules/sassdoc/node_modules/nunjucks/src/environment.js:631:18), <anonymous>:93:3)
    at Template.render (/usr/local/lib/node_modules/sassdoc/node_modules/nunjucks/src/environment.js:550:10)
    at eval (eval at _compile (/usr/local/lib/node_modules/sassdoc/node_modules/nunjucks/src/environment.js:631:18), <anonymous>:119:10)
pascalduez commented 3 years ago

Hi @lperamo,

looking at the error, you most likely have erroneous SassDoc annotations, or something we don't parse properly which apparently break the theme templates. Without looking at some code we won't be able to help much. Maybe try narrowing by just adding the annotations small pieces by small pieces, will help you spot the culprit.

There's probably something to straighten on our side as well, shouldn't crash like this.

lperamo commented 3 years ago

I already tried to change my documentation with no avail the other day but today I succeeded to generate the SASSDoc files so... I will test all my files line by line of documentation ! I'll keep you updated.

lperamo commented 3 years ago

Ok, I weirdly find very quickly this time my error. I had a SASSDoc block like this :

///
/// Main mixin that creates themed empty arrows like > using border hacks
///
/// @access public
/// @param  {array} $options ()
///

Forgotting to put the braces around array was the thing that crashes the SASSDoc library. Hope it helps! Thanks for your time! If you need more details to solve the crash, tell me!

pascalduez commented 3 years ago

Leaving this one open, at least we should try to output an useful error message.