-
Notifications
You must be signed in to change notification settings - Fork 16
Module.id in Windows Includes file extension (.js) Which Disrupts Directory Structure #71
Comments
module.id ultimately gets set in lib/sandbox.js (look for module.id = id). I'm not sure how it's keeping the extension. It might be a bug in the module search algorithm, but more likely one of the file system routines. Would you be able to isolate this? |
I'd like to try to isolate this but I'm not sure where to start. IN sandbox.js i don't see module.id=id. the closest thig i have is
one line 228 or
on line 246. How would you recommend isolating it? Is this something the Rhino debugger may help with? |
Yeah, the Rhino debugger will give you a stack trace; you can put probes (hahah, euphemism for print(data)) into all the active functions and evaluate whether they're doing what they're supposed to, namely, not putting .js in the module identifier. |
I dropped this into sandbox.js
And this is what I got on the Rhino console: global so something is definitely wrong with the way the Tusk module is loaded. What's your recommendation to look into this? |
Oh! This is very helpful. It seems that the narwhal/tusk module is |
Please let me know if this fixes the problem: |
I tried your fix and I think it may have worked, but I can't tell 100% because there appears to be another problem. I tried both applying your patch to the 280 North fork and your repository and got the same results. I ran tusk.cmd help still with that line in sandbox.js to print module.id and got this so it looks like it's finding tusk properly. I ran this again in the debugger and the application just stalled at http-engine.js function(require,exports,module,system,print){ exports.IO = function (url) { // */ I tried commenting out the require(http) like in tusk.js but then it stalls at narwhal/tusk Should I close this ticket and open a new one or is this related? ps Thanks for all your help. |
I was trying to run
but i get the following error:
C:\Gited\280North\narwhal>tusk.cmd help
Usage: help [OPTIONS] COMMAND
A Narwhal project package manager.
require error: couldn't find "C:\Gited\280North\narwhal\lib\narwhal\tusk.js\list"
I looked at tusk.js and found
if i replace this with
The example works. Obviously you can't hard code the file path, but I couldn't find where module.id was set to override the windows behaviour.
I'm running Windows XP SP3
The text was updated successfully, but these errors were encountered: