stampit-org / stampit

OOP is better with stamps: Composable object factories.
https://stampit.js.org
MIT License
3.02k stars 103 forks source link

stampit___default.a(...).props is not a function in Webpack 3 #317

Closed jktravis closed 7 years ago

jktravis commented 7 years ago

Not sure if this is a problem with webpack or stampit, but I created an issue for it on the webpack repo.

https://github.com/webpack/webpack/issues/5241

koresar commented 7 years ago

Great bug reporting! Thank you

I'm out of computer for the next few weeks. Can't run the example.

Can you show full stack trace? Preferably without minification.

jktravis commented 7 years ago

Sure.

TypeError: __WEBPACK_IMPORTED_MODULE_0_stampit___default.a(...).props is not a function
at Object.defineProperty.value (http://localhost:63342/Webpack3StampIt/build/main.js:24:4)
at __webpack_require__ (http://localhost:63342/Webpack3StampIt/build/commons.js:55:30)
at Object. (http://localhost:63342/Webpack3StampIt/build/main.js:7:66)
at __webpack_require__ (http://localhost:63342/Webpack3StampIt/build/commons.js:55:30)
at webpackJsonpCallback (http://localhost:63342/Webpack3StampIt/build/commons.js:26:23)
at http://localhost:63342/Webpack3StampIt/build/main.js:1:1
koresar commented 7 years ago

Could you please check if it's reproducible with stampit@3.0.x ? There was a change in it which might have caused the issue.

If it still throws - then likely it's the webpack bug. If it doesn't - the bug is likely ours.

jktravis commented 7 years ago

It appears to still throw. I tried it with stampit@3.0.6

jktravis commented 7 years ago

I received a reply on the webpack issue. Am I using it wrong now?

https://github.com/webpack/webpack/issues/5241#issuecomment-313846314

koresar commented 7 years ago

The provided workaround is correct. This appears to be stampit bug. I'll have some time to fix it in two weeks. Does the workaround work for you?

jktravis commented 7 years ago

Thanks, @koresar. Yes. The workaround will do.

koresar commented 7 years ago

Early to tell, but this might be fixed here #323

koresar commented 7 years ago

Fixed with stampit v4.