You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Setting Input Decorators fails in production build, but not in development build #198
It works perfectly fine when I do a development build. However when I build it in production mode, no errors are thrown during compiling. However, when I load it in the browser, browser.js throws an Uncaught TypeError... when I look at the trace it shows
function decorate(decorators, target, targetKey, targetDescriptor) {
if (!is_undefined_1.isUndefined(targetDescriptor)) {
if (!is_array_1.isArray(decorators)) {
throw new TypeError();
}
else if (!is_object_1.isObject(target)) {
throw new TypeError();
}
else if (is_undefined_1.isUndefined(targetKey)) {
throw new TypeError();
}
else if (!is_object_1.isObject(targetDescriptor)) {
throw new TypeError(); // <---------- This where where the error is thrown from the browser.js file webpack creates
}
}
The same bug occurs on every other directive that has a input setter as well. What could be the issue?
@gdi2290 It still gives the error (only in production, not dev).
@manavsehgal when I comment out CommonsChunkPlugin for common, it just moves up to vendor to being the file that calls the same error. If I comment out the plugin for vendor it just moves up to main.
Do I need to install a new version of that plugin or redownload this repo? This is the part I commented out on production config, let me know if I'm commenting out the wrong areas.
@gdi2290 The issue persists. I just did a clean install of the latest repo and the error is still there. There is still something wrong with the current build.
Activity
PatrickJS commentedon Jan 4, 2016
can use use
@Input('defaultColor')and see if you have the same error?manavsehgal commentedon Jan 5, 2016
Same as #190
qdouble commentedon Jan 5, 2016
@gdi2290 It still gives the error (only in production, not dev).
@manavsehgal when I comment out CommonsChunkPlugin for common, it just moves up to vendor to being the file that calls the same error. If I comment out the plugin for vendor it just moves up to main.
It works without a problem in plunker, but not in production build: https://plnkr.co/edit/XBqIYu4aHyNi7TJtc5wH?p=preview
Every directive I have with an input setter breaks in production build.
PatrickJS commentedon Jan 5, 2016
oh yeah there was a problem with
CommonsChunkPluginfor common that needs to be removedqdouble commentedon Jan 5, 2016
Do I need to install a new version of that plugin or redownload this repo? This is the part I commented out on production config, let me know if I'm commenting out the wrong areas.
Still not working after commenting out either of the two or both of the above.
PatrickJS commentedon Jan 5, 2016
leave the vendor CommonChunk
PatrickJS commentedon Jan 5, 2016
you also want to move DedupePlugin and OccurenceOrderPlugin to be first
https://github.com/AngularClass/angular2-webpack-starter/blob/master/webpack.prod.config.js#L106
qdouble commentedon Jan 5, 2016
@gdi2290 The issue persists. I just did a clean install of the latest repo and the error is still there. There is still something wrong with the current build.
To reproduce error, all you have to do is...
PatrickJS commentedon Jan 7, 2016
can you update the prod config. see #203
qdouble commentedon Jan 7, 2016
@gdi2290 thanks, it works great now 👍
PatrickJS commentedon Jan 7, 2016
Thanks for opening an issue. If you have any more questions or problems feel free to open another one