flatbuffers icon indicating copy to clipboard operation
flatbuffers copied to clipboard

'this' is converted to 'undefined' by babel in node.js project

Open asmallfurrywombat opened this issue 8 years ago • 3 comments

hi..

I tried following the javascript example but babel 6.26.0, with the 'env' preset, is converting the 'this' in the flatbuffers files to 'undefined'. If i try to set 'modules' to false in the 'env' settings, babel starts complaining about 'import'.

I can get around it for now by doctoring the files to use 'export default' but that's not ideal. Any ideas appreciated!

asmallfurrywombat avatar Mar 01 '18 11:03 asmallfurrywombat

Did you miss the example? And isn't this a problem with Babel, not FlatBuffers?

aardappel avatar Mar 02 '18 18:03 aardappel

Are you referring to javascript_sample.sh? If so, I didn't miss it. It doesn't use babel, but many node projects do so i thought, perhaps, someone might have run into this. Not a blocker, in any case.

asmallfurrywombat avatar Mar 03 '18 03:03 asmallfurrywombat

It doesn't seem to be ringing any bells and it's not blocking so i'll close it.

asmallfurrywombat avatar Mar 03 '18 23:03 asmallfurrywombat