v0.1.10 breaks Node's require() function #73

Closed
devijvers opened this Issue Sep 4, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@devijvers

I get this exception:

/home/steven/dev/xxxxxxxxxxx/node_modules/nools/lib/compile/common.js:26
        throw new Error("Invalid action : " + body + "\n" + e.message);
              ^
Error: Invalid action : ((function(){var io= scope.io;
    return require('/home/steven/dev/xxxxxxxxxxx/src/node/socket.io')
})())
Cannot find module '/home/steven/dev/xxxxxxxxxxx/src/node/socket.io'
    at createFunction (/home/steven/dev/xxxxxxxxxxx/node_modules/nools/lib/compile/common.js:26:15)
    at /home/steven/dev/xxxxxxxxxxx/node_modules/nools/lib/compile/index.js:172:25
    at Array.forEach (native)
    at forEach (/home/steven/dev/xxxxxxxxxxx/node_modules/nools/node_modules/array-extended/index.js:176:21)
    at Object.exports.compile (/home/steven/dev/xxxxxxxxxxx/node_modules/nools/lib/compile/index.js:171:5)
    at Object.nools.compile (/home/steven/dev/xxxxxxxxxxx/node_modules/nools/lib/index.js:288:21)
    at Object.<anonymous> (/home/steven/dev/xxxxxxxxxxx/src/node/nools.js:3:18)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

I didn't have this problem with v0.1.9. To make sure I've downgraded and everything works A-OK.

@doug-martin

This comment has been minimized.

Show comment
Hide comment
@doug-martin

doug-martin Sep 4, 2013

Contributor

What does your global declaration look like?

Contributor

doug-martin commented Sep 4, 2013

What does your global declaration look like?

@devijvers

This comment has been minimized.

Show comment
Hide comment
@devijvers

devijvers Sep 4, 2013

These are the four first lines:

global express = require("express");
global app = express();
global server = require("http").createServer(app);
global io = require("socket.io").listen(server, { log: false });

These are the four first lines:

global express = require("express");
global app = express();
global server = require("http").createServer(app);
global io = require("socket.io").listen(server, { log: false });

doug-martin added a commit to doug-martin/nools that referenced this issue Sep 4, 2013

v0.1.11
* Fixed issue #73 where requires in dsl would treat a file with a `.` character as a path instead of a module.

@doug-martin doug-martin referenced this issue Sep 4, 2013

Merged

v0.1.11 #74

@ghost ghost assigned doug-martin Sep 4, 2013

@doug-martin

This comment has been minimized.

Show comment
Hide comment
@doug-martin

doug-martin Sep 4, 2013

Contributor

Ok this should be fixed in v0.1.11.

Contributor

doug-martin commented Sep 4, 2013

Ok this should be fixed in v0.1.11.

@doug-martin doug-martin closed this Sep 4, 2013

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