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
coffee-script register fails on 1.6.0 & 1.5.1 #8611
Comments
Same here! |
@KagamiChan Does the coffee script register logic work in normal Node.JS |
@MarshallOfSound
I've also tested some coffee scripts with register on v7.4.0 |
@kevinsawicki This looks like a regression due to electron/node@f691373 Because we now return a function from within the wrapping function the (function (exports, require, module, __filename, __dirname, process, global) {
return function (exports, require, module, __filename, __dirname) {
// code
}.call(this, exports, require, module, __filename, __dirname);
}); Haven't had time to test but I think that should do the trick |
@MarshallOfSound awesome, thank you for looking into it |
Wondering if we could have a spec / test for this kind of packages, if |
Thanks for digging into this, will work on an update to that patch. |
Great suggestion @KagamiChan, spec added in #8618 for |
Expected behavior
Coffee-script won't fail with
require('coffee-script').register()
orrequire('coffee-script/register')
Actual behavior
Coffee-script fails to register
How to reproduce
Electron-quick-start
appcoffee-script
vianpm i --save coffee-script
index.html
, for example,(
require('coffee-script').register()
andrequire('coffee-script/register')
will give the same result)Console
tabError message on 1.6.0:
While the same app won't throw any error on 1.5.0 and previous
The lines related to this error in
coffee-script
are:this.FILE_EXTENSIONS
becomesundefinded
but I have no idea how it happensThe text was updated successfully, but these errors were encountered: