Sassdoc won't compile #396

Closed
Nooshu opened this Issue Apr 13, 2015 · 13 comments

Comments

Projects
None yet
5 participants
@Nooshu

Nooshu commented Apr 13, 2015

Hello,

I've currently run into an issue with Sassdoc compiling. I believe it my be a babel issue looking at the logs, but I have been unable to fix it from other tickets. The error i'm getting is:

Registering "/vagrant/node_modules/grunt-sassdoc/tasks" tasks.
Loading "sassdoc.js" tasks...ERROR
>> ReferenceError: Symbol is not defined
>>     at /vagrant/node_modules/grunt-sassdoc/node_modules/sassdoc/node_modules/babel-runtime/regenerator/runtime.js:22:57
>>     at Object.<anonymous> (/vagrant/node_modules/grunt-sassdoc/node_modules/sassdoc/node_modules/babel-runtime/regenerator/runtime.js:511:3)
>>     at Module._compile (module.js:456:26)
>>     at Object.Module._extensions..js (module.js:474:10)
>>     at Module.load (module.js:356:32)
>>     at Function.Module._load (module.js:312:12)
>>     at Module.require (module.js:364:17)
>>     at require (module.js:380:17)
>>     at Object.<anonymous> (/vagrant/node_modules/grunt-sassdoc/node_modules/sassdoc/node_modules/babel-runtime/regenerator/index.js:12:18)
>>     at Module._compile (module.js:456:26)
Warning: Task "sassdoc" failed. Use --force to continue.

After installing sassdoc globally and running sassdoc --version I get the following error:

/usr/lib/node_modules/sassdoc/node_modules/babel-runtime/regenerator/runtime.js:22
  var iteratorSymbol = typeof _Symbol === "function" && Symbol.iterator || "@@
                                                        ^
ReferenceError: Symbol is not defined
    at /usr/lib/node_modules/sassdoc/node_modules/babel-runtime/regenerator/runtime.js:22:57
    at Object.<anonymous> (/usr/lib/node_modules/sassdoc/node_modules/babel-runtime/regenerator/runtime.js:511:3)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/lib/node_modules/sassdoc/node_modules/babel-runtime/regenerator/index.js:12:18)
    at Module._compile (module.js:456:26)

My sassdoc grunt task is very simple:

'default': {
            'src': '<%= app.sass %>',
            'options': {
                'dest': '<%= app.dist %>/sassdocs',
                'display': {
                    'watermark': false
                },
                'package': './package.json'
            }
        }

Any feedback would be appreciated.
Thanks!

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
@valeriangalliat

valeriangalliat Apr 13, 2015

Member

I'm unable to reproduce. Is this a fresh SassDoc installation? Maybe try to uninstall/reinstall it to be sure all dependencies are up-to-date...

Member

valeriangalliat commented Apr 13, 2015

I'm unable to reproduce. Is this a fresh SassDoc installation? Maybe try to uninstall/reinstall it to be sure all dependencies are up-to-date...

@pascalduez

This comment has been minimized.

Show comment
Hide comment
@pascalduez

pascalduez Apr 13, 2015

Member

What's the list of Grunt plugins loaded by your Gruntfile ?
Might be another case for #360

EDIT:
Either a local or global install works fine for me. sassdoc@2.1.8

Member

pascalduez commented Apr 13, 2015

What's the list of Grunt plugins loaded by your Gruntfile ?
Might be another case for #360

EDIT:
Either a local or global install works fine for me. sassdoc@2.1.8

@Nooshu

This comment has been minimized.

Show comment
Hide comment
@Nooshu

Nooshu Apr 14, 2015

Thanks for the reply. Here's a list of the npm modules that are bing used:

"devDependencies": {
    "assemble": "git://github.com/assemble/assemble#handlebars-2.0.0",
    "bower": "~1.3.12",
    "browserify": "^9.0.8",
    "browserify-shim": "^3.8.5",
    "debowerify": "^1.2.0",
    "grunt": "~0.4.5",
    "grunt-accessibility": "^2.2.0",
    "grunt-autoprefixer": "^2.2.0",
    "grunt-browser-sync": "^2.0.0",
    "grunt-browserify": "^3.6.0",
    "grunt-combine-media-queries": "^1.0.19",
    "grunt-concurrent": "~1.0.0",
    "grunt-contrib-clean": "~0.6.0",
    "grunt-contrib-compress": "~0.13.0",
    "grunt-contrib-copy": "~0.7.0",
    "grunt-contrib-jshint": "~0.10.0",
    "grunt-contrib-uglify": "~0.7.0",
    "grunt-githooks": "^0.3.1",
    "grunt-jscs": "^1.2.0",
    "grunt-jsdoc": "^0.6.2",
    "grunt-modernizr": "~0.6.0",
    "grunt-newer": "~1.1.0",
    "grunt-notify": "^0.4.1",
    "grunt-sass": "^0.18.0",
    "grunt-sass-globbing": "^1.1.0",
    "grunt-sassdoc": "^2.0.0",
    "grunt-scss-lint": "^0.3.4",
    "grunt-shell": "^1.1.1",
    "grunt-simple-watch": "^0.1.2",
    "grunt-string-replace": "^1.0.0",
    "grunt-stripmq": "~0.0.6",
    "handlebars": "^2.0.0",
    "helper-moment": "^0.1.3",
    "ink-docstrap": "^0.4.12",
    "jit-grunt": "^0.9.1",
    "jsdoc": "^3.3.0-alpha13",
    "load-grunt-config": "~0.16.0",
    "time-grunt": "https://registry.npmjs.org/time-grunt/-/time-grunt-0.4.0.tgz"
  },

The only thing that has really changed with the setup over the past few days is changing from requirejs to browserify. Maybe that could be causing the issue?

Nooshu commented Apr 14, 2015

Thanks for the reply. Here's a list of the npm modules that are bing used:

"devDependencies": {
    "assemble": "git://github.com/assemble/assemble#handlebars-2.0.0",
    "bower": "~1.3.12",
    "browserify": "^9.0.8",
    "browserify-shim": "^3.8.5",
    "debowerify": "^1.2.0",
    "grunt": "~0.4.5",
    "grunt-accessibility": "^2.2.0",
    "grunt-autoprefixer": "^2.2.0",
    "grunt-browser-sync": "^2.0.0",
    "grunt-browserify": "^3.6.0",
    "grunt-combine-media-queries": "^1.0.19",
    "grunt-concurrent": "~1.0.0",
    "grunt-contrib-clean": "~0.6.0",
    "grunt-contrib-compress": "~0.13.0",
    "grunt-contrib-copy": "~0.7.0",
    "grunt-contrib-jshint": "~0.10.0",
    "grunt-contrib-uglify": "~0.7.0",
    "grunt-githooks": "^0.3.1",
    "grunt-jscs": "^1.2.0",
    "grunt-jsdoc": "^0.6.2",
    "grunt-modernizr": "~0.6.0",
    "grunt-newer": "~1.1.0",
    "grunt-notify": "^0.4.1",
    "grunt-sass": "^0.18.0",
    "grunt-sass-globbing": "^1.1.0",
    "grunt-sassdoc": "^2.0.0",
    "grunt-scss-lint": "^0.3.4",
    "grunt-shell": "^1.1.1",
    "grunt-simple-watch": "^0.1.2",
    "grunt-string-replace": "^1.0.0",
    "grunt-stripmq": "~0.0.6",
    "handlebars": "^2.0.0",
    "helper-moment": "^0.1.3",
    "ink-docstrap": "^0.4.12",
    "jit-grunt": "^0.9.1",
    "jsdoc": "^3.3.0-alpha13",
    "load-grunt-config": "~0.16.0",
    "time-grunt": "https://registry.npmjs.org/time-grunt/-/time-grunt-0.4.0.tgz"
  },

The only thing that has really changed with the setup over the past few days is changing from requirejs to browserify. Maybe that could be causing the issue?

@gearsdigital

This comment has been minimized.

Show comment
Hide comment
@gearsdigital

gearsdigital Apr 14, 2015

I've the same issue and I'm able to provide a basic test case (if needed) to debug this issue.

The problem ReferenceError: Symbol is not defined is located in

node_modules/grunt-sassdoc/node_modules/sassdoc/node_modules/babel-runtime/regenerator/index.js

This error happens until i change the following lines in babel-runtime/regenerator/index.js.

Please note the missing ""!_

Line 22

var iteratorSymbol = typeof _Symbol === "function" && Symbol.iterator || "@@iterator";
// should be 
var iteratorSymbol = typeof _Symbol === "function" && _Symbol.iterator || "@@iterator";

Line 123

Promise.resolve(info.value).then(callNext, callThrow);
// should be 
_Promise.resolve(info.value).then(callNext, callThrow);

This is fixed in a newer version of babel-runtime. @see babel/babel#1261

So it should be enough to update the SassDoc package.json:

// https://github.com/SassDoc/sassdoc/blob/master/package.json#L81
"babel-runtime": "5.0.*" ->  "babel-runtime": "babel": "^5.0.*"

I've the same issue and I'm able to provide a basic test case (if needed) to debug this issue.

The problem ReferenceError: Symbol is not defined is located in

node_modules/grunt-sassdoc/node_modules/sassdoc/node_modules/babel-runtime/regenerator/index.js

This error happens until i change the following lines in babel-runtime/regenerator/index.js.

Please note the missing ""!_

Line 22

var iteratorSymbol = typeof _Symbol === "function" && Symbol.iterator || "@@iterator";
// should be 
var iteratorSymbol = typeof _Symbol === "function" && _Symbol.iterator || "@@iterator";

Line 123

Promise.resolve(info.value).then(callNext, callThrow);
// should be 
_Promise.resolve(info.value).then(callNext, callThrow);

This is fixed in a newer version of babel-runtime. @see babel/babel#1261

So it should be enough to update the SassDoc package.json:

// https://github.com/SassDoc/sassdoc/blob/master/package.json#L81
"babel-runtime": "5.0.*" ->  "babel-runtime": "babel": "^5.0.*"
@gearsdigital

This comment has been minimized.

Show comment
Hide comment
@gearsdigital

gearsdigital Apr 14, 2015

@Nooshu To temporally fix this issue you could do this:

// head to sassdoc folder
cd path/to/node_modules/sassdoc

open the package.json, make changes mentioned above (5.0.* to ^5.0.* ) and run npm install from the directory.

@Nooshu To temporally fix this issue you could do this:

// head to sassdoc folder
cd path/to/node_modules/sassdoc

open the package.json, make changes mentioned above (5.0.* to ^5.0.* ) and run npm install from the directory.

@pascalduez

This comment has been minimized.

Show comment
Hide comment
@pascalduez

pascalduez Apr 14, 2015

Member

Thanks @gearsdigital for the debug, I'm currently rolling a fix.

Member

pascalduez commented Apr 14, 2015

Thanks @gearsdigital for the debug, I'm currently rolling a fix.

@gearsdigital

This comment has been minimized.

Show comment
Hide comment
@gearsdigital

gearsdigital Apr 14, 2015

You're very welcome!

You're very welcome!

@Nooshu

This comment has been minimized.

Show comment
Hide comment
@Nooshu

Nooshu Apr 14, 2015

@gearsdigital & @pascalduez excellent, the temp fix works for the moment, and will update once a proper fix has been rolled out.

Thanks for your help!

Nooshu commented Apr 14, 2015

@gearsdigital & @pascalduez excellent, the temp fix works for the moment, and will update once a proper fix has been rolled out.

Thanks for your help!

@pascalduez

This comment has been minimized.

Show comment
Hide comment
@pascalduez

pascalduez Apr 15, 2015

Member

The upgrade to Babel 5.1 breaks a few things, so it's gonna be a little be longer. I will look again at it this evening.

Member

pascalduez commented Apr 15, 2015

The upgrade to Babel 5.1 breaks a few things, so it's gonna be a little be longer. I will look again at it this evening.

@gearsdigital

This comment has been minimized.

Show comment
Hide comment
@gearsdigital

gearsdigital Apr 15, 2015

Would be great! Let me know if you need some help...

Would be great! Let me know if you need some help...

@drewbolles

This comment has been minimized.

Show comment
Hide comment
@drewbolles

drewbolles Apr 15, 2015

I manually updated babel and babel-runtime to 5.1.9 and my SassDoc was able to compile. I didn't see anything out of the ordinary in my rendered file.

I manually updated babel and babel-runtime to 5.1.9 and my SassDoc was able to compile. I didn't see anything out of the ordinary in my rendered file.

pascalduez added a commit that referenced this issue Apr 15, 2015

@pascalduez

This comment has been minimized.

Show comment
Hide comment
@pascalduez

pascalduez Apr 15, 2015

Member

Fixed as of SassDoc 2.1.9

Member

pascalduez commented Apr 15, 2015

Fixed as of SassDoc 2.1.9

@pascalduez pascalduez closed this Apr 15, 2015

@Nooshu

This comment has been minimized.

Show comment
Hide comment
@Nooshu

Nooshu Apr 16, 2015

Perfect! All works now. Thanks for the quick response.

Nooshu commented Apr 16, 2015

Perfect! All works now. Thanks for the quick response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment