Closed abraham closed 1 year ago
Doesn't work with InversifyJS
import "@abraham/reflection";
import { Container, injectable } from "inversify";
const myContainer = new Container();
const TYPES = {
Ninja: Symbol("Ninja")
};
@injectable()
class Ninja {}
myContainer.bind<Ninja>(TYPES.Ninja).to(Ninja);
const ninja = myContainer.get<Ninja>(TYPES.Ninja);
Error:
Uncaught TypeError: Reflect.hasMetadata is not a function
at _postConstruct (instantiation.js:24)
at Object.resolveInstance (instantiation.js:47)
at resolver.js:72
at Object.resolve (resolver.js:96)
at container.js:319
at Container../node_modules/inversify/lib/container/container.js.Container._get (container.js:310)
at Container../node_modules/inversify/lib/container/container.js.Container.get (container.js:230)
at Object../src/inversifytest.ts (inversifytest.ts:15)
at __webpack_require__ (bootstrap ee47681dc696ba0b4a90:678)
at fn (bootstrap ee47681dc696ba0b4a90:88)
at Object../src/index.tsx (index.tsx:1)
at __webpack_require__ (bootstrap ee47681dc696ba0b4a90:678)
at fn (bootstrap ee47681dc696ba0b4a90:88)
at Object.0 (inversifytest.ts:15)
at __webpack_require__ (bootstrap ee47681dc696ba0b4a90:678)
at bootstrap ee47681dc696ba0b4a90:724
at bootstrap ee47681dc696ba0b4a90:724
I tested it within webpack but error is pretty clear. @abraham/reflection
doesn't define Reflect.hasMetadata
.
@elderapo please create a new issue for that. This feature request is for tracking adding additional framework tests.
Add an
examples
directory with a simple app of each of the following frameworks/libraries. The samples should make use of Reflection and have their tests run on CI. This will provide examples for developers of those libraries and make sure Reflection doesn't break compatibility. Lerna might be a good choice to manage the examples.