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
Async import returning undefined default export #5544
Comments
@milesj Have you tried to use UglifyJs plugin from webpack-contrib with and without |
@sgal I have not. Wasn't aware it was using ES now, will give that a try. |
Any updates? |
@sokra I tested a bit. If I remember correctly, 3.1 (current), 3.2, and 3.3 worked. 3.4 and 3.5 were problematic. I'm going to try using the plugin mentioned above and upgrading again. I'll report back. |
This is a super weird issue... Are you familiar with git bisect? |
Just tested with the beta uglify plugin and the issues seems to have gone away. Will monitor a bit more before closing this. |
Issue has returned again using Webpack 3.5.5 and Uglify 1.0.0-beta. |
@milesj issue still exists with latest |
Can't say that it has. It magically has gone away. We're using webpack 3.8.1 and uglifyjs-webpack-plugin 1.0.1. I'll close this issue for now. |
I am facing this issue when I build with my prod config. In development it works fine. <Route
path="print"
getComponent={(nextState, callback) => {
import('./components/PrintTransaction/PrintTransaction')
.then((module) => {
console.log("module :: ", module);
callback(null, module.default);
});
}} but the log doesn't have This is getting generated in the transpiled code. /* harmony default export */ __webpack_exports__["default"] = (Object(__WEBPACK_IMPORTED_MODULE_2_react_redux__["b" /* connect */])(mapStateToProps, mapDispatchToProps)(Object(__WEBPACK_IMPORTED_MODULE_3__WrapperComponent_WrapperComponent__["b" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_4__withPrintUtils__["a" /* default */])(PrintTransaction)))); In chrome console, I am getting error #959 and In Firefox console I get #5429. I tried to setup the a test repo for this, But there it is working fine. Webpack Version : 3.9.1 |
@revathskumar @milesj Just curious, are you both using CommonsChunkPlugin in the environment you were using when this happened? |
@kgrz I was not. |
@kgrz @milesj with the help @HarshwardhanSingh we figured it out as our issue is related to webpack-contrib/extract-text-webpack-plugin#456. When we remove the |
Do you want to request a feature or report a bug?
Bug.
What is the current behavior?
This is hard to explain, so I'll try my best. When using Webpack 3.5 + UglifyES + React Loadable, some of my default exports via
import()
are undefined and missing.For example, here's the output of the
import()
result in the latest Webpack. Which in turn causes React to throw undefined rendering errors.And here's the output when I downgrade Webpack.
And here's my rudimentary debugging. The Messaging import works just fine, but the Notifications one does not. Both files being imported have a single default export with no named exports.
Things I've tried:
react-loadable
while using the latest Webpack and the problem persists.Currently testing against each Webpack version to see where the bug was introduced.
If the current behavior is a bug, please provide the steps to reproduce.
Here's my Webpack setup: https://gist.github.com/milesj/5c9179df651529335203bec6aee2d6fd
What is the expected behavior?
That
import()
doesn't lose my default export.If this is a feature request, what is motivation or use case for changing the behavior?
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
Node v6.10.0
NPM v3.10.10
Webpack v3.*
webpack-parallel-uglify-plugin v1
The text was updated successfully, but these errors were encountered: