Skip to content
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

Reflect-Metadata doesn't work with WebPack 3 Scope Hoisting #77

Open
CmdrShepardsPie opened this issue Aug 2, 2017 · 1 comment
Open

Comments

@CmdrShepardsPie
Copy link

I tried reporting this to the WebPack team and they said it is a problem with Reflect-Metadata.

I'm using Reflect-Metadata in a TypeScript project that's being built and bundled with WebPack 3. When I add the scope hoisting plugin to my WebPack config, the project no longer runs properly.

I get the following error:
Uncaught TypeError: Reflect.hasOwnMetadata is not a function
at injectable.js:7
at Object.__decorate [as a] (tslib.es6.js:48)
at Object../client/app/app.bootstrap.ts (data.service.ts:4)
at webpack_require (bootstrap 1856459e76a82a034076:54)
at webpackJsonpCallback (bootstrap 1856459e76a82a034076:25)
at app.js:1
(anonymous) @ injectable.js:7
__decorate @ tslib.es6.js:48
./client/app/app.bootstrap.ts @ data.service.ts:4
webpack_require @ bootstrap 1856459e76a82a034076:54
webpackJsonpCallback @ bootstrap 1856459e76a82a034076:25
(anonymous) @ app.js:1

Is there a way to make it work, or can this problem be fixed?

@danzel
Copy link

danzel commented Mar 2, 2018

Seems totally busted in webpack 4.
In my limited debugging it looks like reflect-metadata is not getting included in the resulting bundle at all.

Edit: Or maybe it is?
I tried to use webpack shims, but that didn't get it going either, I may have been using it wrong however.

Edit2: I think I was doing something wrong, I re-did the update on our app and things are fine 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants