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

Code cannot parse src code #194

Closed
victorteokw opened this issue Feb 8, 2015 · 10 comments
Closed

Code cannot parse src code #194

victorteokw opened this issue Feb 8, 2015 · 10 comments

Comments

@victorteokw
Copy link

I've tried several versions, neither works.
The most recent version (2.0.8 and 2.0.9) generates this error.

localhost:chess 1$ node_modules/codo/bin/codo src/js --output doc
error: Cannot parse Coffee file /path/to/my/project/src/js/controller/base.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/controller/game_controller.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/model/bishop.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/model/call.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/model/chess_board.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/model/chess_game.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/model/coordinate.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/model/king.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/model/knight.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/model/pawn.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/model/piece.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/model/queen.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/model/rook.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/model/uuid.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/view/basic_view.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/view/bishop_view.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/view/color.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/view/div_view.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/view/game_view.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/view/grid_view.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/view/king_view.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/view/knight_view.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/view/label_view.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/view/metrics.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/view/panel_view.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/view/pawn_view.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/view/piece_view.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/view/queen_view.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/view/rook_view.js.coffee: node is not defined
error: Cannot parse Coffee file /path/to/my/project/src/js/view/window.js.coffee: node is not defined

/path/to/my/project/node_modules/codo/lib/entities/class.coffee:133
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                              ^
TypeError: Cannot read property 'length' of undefined
  at Class.module.exports.Entities.Class.Class.linkifyValue (/path/to/my/project/node_modules/codo/lib/entities/class.coffee:97:5)
  at Class.module.exports.Entities.Class.Class.linkify (/path/to/my/project/node_modules/codo/lib/entities/class.coffee:74:10)
  at Environment.module.exports.Environment.linkify (/path/to/my/project/node_modules/codo/lib/environment.coffee:123:12)
  at Object.module.exports.Codo.parseProject (/path/to/my/project/node_modules/codo/lib/codo.coffee:56:17)
  at Command.module.exports.Command.generate (/path/to/my/project/node_modules/codo/lib/command.coffee:106:24)
  at new Command (/path/to/my/project/node_modules/codo/lib/command.coffee:84:8)
  at Function.module.exports.Command.run (/path/to/my/project/node_modules/codo/lib/command.coffee:25:5)
  at Object.<anonymous> (/path/to/my/project/node_modules/codo/bin/codo:14:19)
  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 Function.Module.runMain (module.js:497:10)
  at startup (node.js:119:16)
  at node.js:902:3
@tristanjahier
Copy link

I've got the same error here: error: Cannot parse Coffee file /path/hey/plop/blabla.coffee: node is not defined

I'm on Windows 7.

@Torthu
Copy link

Torthu commented Feb 9, 2015

Same error here as well

I'm using:
codo v2.0.9
OS X 10.10.2
node.js v0.10.21
CoffeeScript version 1.9.0

@aseemk
Copy link

aseemk commented Feb 10, 2015

I was getting this too when Codo's internal CoffeeScript dependency was 1.9. I manually uninstalled it and had it use a 1.8 (higher up node_modules), and it worked fine then.

aseemk added a commit to thingdom/node-neo4j that referenced this issue Feb 10, 2015
Unfortunately it seems broken at the moment:

coffeedoc/codo#194
coffeedoc/codo#195

And the auto-webhook site is down too:

coffeedoc/coffeedoc.info#9

Given these issues, going to just write docs manually.
@tristanjahier
Copy link

I don't really know why but my problem auto-solved...
I uninstalled coffee-script then re-installed coffee-script 1.8 (npm install coffee-script@1.8.0) and codo.
Later, I rolled back to 1.9.0 but it's still working... so I'm confused.

@victorteokw
Copy link
Author

It still happens when using coffee1.8.0

aseemk added a commit to thingdom/node-neo4j that referenced this issue Feb 19, 2015
Unfortunately it seems broken at the moment:

coffeedoc/codo#194
coffeedoc/codo#195

And the auto-webhook site is down too:

coffeedoc/coffeedoc.info#9

Given these issues, going to just write docs manually.
@bernhard-42
Copy link

codo uses its own coffee-script folder in codo/node_modules. So the simplest workaround until this is resolved seems to be (at least it worked for me):

  • goto e.g. on a Mac /usr/local/lib/node_modules/codo

  • edit package.json so that it has

    "dependencies": {
        "coffee-script": "= 1.8.0",
    
  • Now install coffeescript 1.8.0 for codo only

    rm -fr node_modules/coffee-script
    npm install
    

Note: The code to document should not use coffeescript 1.9.0 features

@bernhard-42
Copy link

The fix seems to be fairly simple:
codo/lib/entities/method.coffee line 9 and 10 are:

 9 constructor: (@environment, @file, @node) ->
10 @name = [node.variable.base.value]

but should be

 9 constructor: (@environment, @file, @node) ->
10 @name = [@node.variable.base.value]

Just add the @ in line 10 in front of node.

aseemk added a commit to thingdom/node-neo4j that referenced this issue Mar 7, 2015
Unfortunately it seems broken at the moment:

coffeedoc/codo#194
coffeedoc/codo#195

And the auto-webhook site is down too:

coffeedoc/coffeedoc.info#9

Given these issues, going to just write docs manually.
aseemk added a commit to thingdom/node-neo4j that referenced this issue Mar 8, 2015
Unfortunately it seems broken at the moment:

coffeedoc/codo#194
coffeedoc/codo#195

And the auto-webhook site is down too:

coffeedoc/coffeedoc.info#9

Given these issues, going to just write docs manually.
@harlantwood
Copy link
Contributor

I had this issue, and using the latest version from github fixes it for me. Tip: to get the latest version from github into your package.json until the fixes are released, just use:

"codo": "coffeedoc/codo",

aseemk added a commit to thingdom/node-neo4j that referenced this issue Mar 11, 2015
Unfortunately it seems broken at the moment:

coffeedoc/codo#194
coffeedoc/codo#195

And the auto-webhook site is down too:

coffeedoc/coffeedoc.info#9

Given these issues, going to just write docs manually.
@aseemk
Copy link

aseemk commented Mar 14, 2015

Nice work folks. Would you mind publishing this update to npm? Thanks!

@inossidabile
Copy link
Member

2.0.11 released

aseemk added a commit to thingdom/node-neo4j that referenced this issue Mar 27, 2015
Unfortunately it seems broken at the moment:

coffeedoc/codo#194
coffeedoc/codo#195

And the auto-webhook site is down too:

coffeedoc/coffeedoc.info#9

Given these issues, going to just write docs manually.
aseemk added a commit to thingdom/node-neo4j that referenced this issue Jun 7, 2015
Unfortunately it seems broken at the moment:

coffeedoc/codo#194
coffeedoc/codo#195

And the auto-webhook site is down too:

coffeedoc/coffeedoc.info#9

Given these issues, going to just write docs manually.
aseemk added a commit to thingdom/node-neo4j that referenced this issue Jun 11, 2015
Unfortunately it seems broken at the moment:

coffeedoc/codo#194
coffeedoc/codo#195

And the auto-webhook site is down too:

coffeedoc/coffeedoc.info#9

Given these issues, going to just write docs manually.
aseemk added a commit to thingdom/node-neo4j that referenced this issue Mar 28, 2016
Unfortunately it seems broken at the moment:

coffeedoc/codo#194
coffeedoc/codo#195

And the auto-webhook site is down too:

coffeedoc/coffeedoc.info#9

Given these issues, going to just write docs manually.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants