I am trying to migrate to flatbuffers-2.0 and am running into this. I am using javascript on client side ( browser ) and sending flatbuffers to C++ server. All fine except , the client stopped working with error
"Uncaught ReferenceError: exports is not defined"The problematic statement is "Object.defineProperty(exports, "__esModule", { value: true });"
I am using typescript compiler ( tsc ) to compile typescript emitted by flatc compiler.
my command is like "tsc --target ES5 --module amd --outFile peer_generated.js *.ts"
if i give any thing other than "amd" or "system" for module option , things dont work.
A google search leads to confusing solutions which are mostly nodejs based.
Thanks & regards,
-rk