nexe: module.exports = X = function() does not work

This is a

  • Bug Report

The following code will fail after compile into binary with nexe.
module.exports = test = function() {
    console.log('hello world');
}
test();

Output error.

nexe.js:3
module.exports = test = function() {
                      ^

ReferenceError: test is not defined
    at Object.__dirname.1 (nexe.js:3:23)
    at s (nexe.js:1:316)
    at e (nexe.js:1:487)
    at nexe.js:1:505
    at NativeModule.compile (node.js:964:5)
    at Function.NativeModule.require (node.js:909:18)
    at Function.Module._load (module.js:285:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at [eval]:1:1



Please also provide:

  • Platform(OS/Version): mac os 10.12.4
  • Host Node Version: 4.5.0
  • Target Node Version: 4.4.7
  • Nexe version: 1.1.2
  • Python Version: 2.7.10

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (11 by maintainers)

Most upvoted comments

I can’t join gitter right now but I’ll look through it, also, we should chat about the project at some point.