Webpack default entry issue: webpackConfig.entry.main.unshift is not a function. #1640

Closed
opened 2025-08-09 17:21:04 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @laskoviymishka on 4/29/2016

There is a statement inside of webpack dev middleware ts:
webpackConfig.entry['main'].unshift('webpack-hot-middleware/client');

Beside assuming that we have default main entry (which is not really good, but there is already TODO here), this allso assume that entry point is an array. Webpack is allow to you have this entry as a string.
Webpack ng2 starter as example have following config:
entry: { 'polyfills': './src/polyfills.ts', 'vendor': './src/vendor.ts', 'main': './src/main.browser.ts' },
In this scenario you will have error:
webpackConfig.entry.main.unshift is not a function.

*Originally created by @laskoviymishka on 4/29/2016* There is a statement inside of webpack dev middleware ts: `webpackConfig.entry['main'].unshift('webpack-hot-middleware/client');` Beside assuming that we have default main entry (which is not really good, but there is already TODO here), this allso assume that entry point is an array. Webpack is allow to you have this entry as a string. Webpack ng2 starter as example have following config: `entry: { 'polyfills': './src/polyfills.ts', 'vendor': './src/vendor.ts', 'main': './src/main.browser.ts' },` In this scenario you will have error: webpackConfig.entry.main.unshift is not a function.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1640
No description provided.