-
Notifications
You must be signed in to change notification settings - Fork 62
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
4.0.9 to 6.9 in Haxe RC2 - Buffer of undefined #121
Comments
Hm.. well, haxe-language-server uses |
ok. I was able to create a mostly small app. I believe it is the inclusion of haxe-modular that creates the issue. Maybe this should be a haxe modular issue? |
It works with haxe modular and 4.0.9. it was the change to hxnodejs to 6 that caused the issue to arise |
@elsassph Thoughts? |
It maybe unrelated but through Googling it appears require("") will be undefined with circular logic. A requires B which then requires A... |
Looks like a Modular bug yes because it stubs the |
|
Adding |
Hmm mot sure to understand the macro context thing. We used to have both js and nodejs defines. Should I change the tests to hardcode |
The problem was that if you had code like this: #if cpp
// use cpp specific API
// (other targets)
#elseif nodejs
// use some node specific API
#end ..it would fall apart if the macro context comes across that. Effectively, it meant that the For your use case, Surprised this hasn't come up earlier, this change happened quite a while ago and people have been using dev versions of hxnodejs for ages before the new Haxelib release. :) |
It's getting OT but how are you supposed to know it's server or client side JS? Sounds like I need to assume |
I'm not sure I follow. It's not like |
Looks like -lib hxnodejs
--macro Main.foo() While this doesn't: --macro Main.foo()
-lib hxnodejs |
We have a nodejs application coming out of Haxe code. Somewhere down at line 22000 in our JS Output we have a
require("Buffer").Buffer
We updated hxnodejs to 6.x. Now with our NodeJS server we are getting a "TypeError: Cannot read property 'Buffer' of undefined"
Line 4 of the JS output has
var require = (function(r){ return function require(m) { return r[m]; } })($s.__registry__ || {});
Commenting this out allows the server to run. It probably will error on anything requiring Buffer...but that isnt tested
The text was updated successfully, but these errors were encountered: