ajaxorg / ace

Ace (Ajax.org Cloud9 Editor)
https://ace.c9.io
Other
26.76k stars 5.29k forks source link

XQuery mode and tree_ops.js #2637

Closed apb2006 closed 8 years ago

apb2006 commented 9 years ago

Using http://ace.c9.io/build/kitchen-sink.html. The console shows errors related to a missing file tree_ops.js. This causes failure of the worker. Seems to have become broken around/after ace release 1.8.

The script at 'http://ace.c9.io/build/src/ace/mode/tree_ops.js' failed to load.

image

cc: @wcandillon

wcandillon commented 9 years ago

@apb2006 Can you confirm if the issue is solved on the master at https://github.com/wcandillon/ace? If yes I will propose it for merging. If not, I will fix it regardless.

apb2006 commented 9 years ago

@wcandillon I tried this but maybe I am missing some steps? I checkout https://github.com/wcandillon/ace and run node ./static.js "NetworkError: 404 Not Found - http://localhost:8888/lib/ace/mode/xquery/lexer.js" "NetworkError: 404 Not Found - http://localhost:8888/lib/ace/mode/xquery/XQueryTokenizer.js"

The readme says:

This files are build from xqlint (using the grunt ace_build)

wcandillon commented 9 years ago

@nightwing the following commands don't work anymore:

$node tool/update_deps.js xquery
$node tool/update_deps.js jsoniq
$node tool/update_deps.js xqlint

Has this mechanism been replaced with something else?

nightwing commented 9 years ago

@wcandillon the default parameters passed to browserify have changed a bit, but otherwise it is the same. What errors do you see?

wcandillon commented 9 years ago

@nightwing The browserify dependency is not in package.json. Once it installed it, I got the following error:

Williams-MacBook-Pro:ace wcandillon$ node tool/update_deps.js jsoniq

fs.js:439
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOTDIR, not a directory '/Users/wcandillon/tmp/ace/node_modules/browser-pack/index.js/../prelude.js'
    at Object.fs.openSync (fs.js:439:18)
    at Object.fs.readFileSync (fs.js:290:15)
    at done (/Users/wcandillon/tmp/ace/tool/update_deps.js:274:55)
    at ChildProcess.done (/Users/wcandillon/tmp/ace/tool/update_deps.js:239:9)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:766:16)
    at Socket.<anonymous> (child_process.js:979:11)
    at Socket.emit (events.js:95:17)
    at Pipe.close (net.js:466:12)
nightwing commented 9 years ago

did you run npm install?

wcandillon commented 9 years ago

@nightwing yes

nightwing commented 9 years ago

Interesting, which version of browser-pack did it install? It must have browser-pack@5.0.1 in tool/node_modules (see tool/package.json#L5)

wcandillon commented 9 years ago

@nightwing Didn't notice the tool/package.json file. How do you install the deps for it? The following didn't work for me:

Williams-MacBook-Pro:ace wcandillon$ cd tool/ && npm install
npm WARN package.json ace-tools@0.1.0 No repository field.
npm WARN package.json css-stringify@1.0.3 No repository field.
npm WARN package.json css-parse@1.0.3 No repository field.
npm ERR! Error: ENOENT, chmod '/Users/wcandillon/tmp/ace/tool/node_modules/csslint/cli.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 14.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/wcandillon/tmp/ace/tool
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! path /Users/wcandillon/tmp/ace/tool/node_modules/csslint/cli.js
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/wcandillon/tmp/ace/tool/npm-debug.log
npm ERR! not ok code 0
nightwing commented 9 years ago

looks like csslint/cli.js belongs to root or something rm -rf node_modules before installing

wcandillon commented 9 years ago

I have the same issue on both node 0.10 and 0.12:

Williams-MacBook-Air:tool wcandillon$ node update_deps.js xquery
fs.js:0
(function (exports, require, module, __filename, __dirname) { // Copyright Joy

Error: ENOTDIR, not a directory '/Users/wcandillon/tmp/ace/tool/node_modules/browser-pack/index.js/../prelude.js'
    at Error (native)
    at Object.fs.openSync (fs.js:500:18)

Not sure what to do that this point. Can you recommend an environment for which the commands would work?

nightwing commented 9 years ago

Found the error, please try with https://github.com/ajaxorg/ace/commit/8ab413cbd400ce0cd6dd809d56c2b82a7a7f5c38

wcandillon commented 9 years ago

@nightwing That fixes it. Thanks!

wcandillon commented 9 years ago

@nightwing thanks for the support. I proposed a fix for merging.

apb2006 commented 9 years ago

Works for me. Thanks

wcandillon commented 8 years ago

@nightwing Another user is affected by this issue, is it possible to merge #2641?