Running the first example in the docs
https://github.com/inversify/InversifyJS/blob/master/wiki/classes_as_id.md
It should compile without issues
I obtain the following error:
````/Volumes/Repo/Projects/inversifyjs-playground/dist/app.js:11
Katana = __decorate([
^
ReferenceError: __decorate is not defined
at /Volumes/Repo/Projects/inversifyjs-playground/dist/app.js:11:5
````
You can just build and run my playground repo:
https://github.com/Deviad/inversifyjs-playground
/Volumes/Repo/Projects/inversifyjs-playground/dist/app.js:11
Katana = __decorate([
^
ReferenceError: __decorate is not defined
at /Volumes/Repo/Projects/inversifyjs-playground/dist/app.js:11:5
at Object.<anonymous> (/Volumes/Repo/Projects/inversifyjs-playground/dist/app.js:15:2)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
at Function.Module.runMain (module.js:701:10)
at startup (bootstrap_node.js:194:16)
at bootstrap_node.js:618:3
I had to install ts-helpers and enable support for them in tsconfig "importHelpers": true,
the problem is in your tsconfig.json. Typescript is not creating the __decorate function in the file.
set "noEmitHelpers": false,
Yes, correct. Thank you.
Most helpful comment
the problem is in your tsconfig.json. Typescript is not creating the __decorate function in the file.
set
"noEmitHelpers": false,