-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Error from UglifyJs - Name Expected #5682
Comments
Ah after looking at this some more, I've figured something out. It looks like this only happens when the imported file is in a sibling to the root folder. So the following folder structure:
When this happens, for some reason the javascript in request.js does not get transpiled by babel which causes Uglify to fail. I'm not sure if this is an issue with webpack, babel-loader, or my configuration. |
Ah I have since learned that this is because there is no .babelrc in the sibling directory (util in my example). Seems like this is an issue I am having with babel and not webpack I'm going to close it. And FWIW, my solution is to pull my webpack config up into the root directory. |
I ran into this due to a 3rd party module that was providing es6 code (similar to @jakeleboeuf it was related to date-holidays-parser). The specific error ( A quick fix is to make sure that babel transpile the module(s) in question. For
Edit: For
And then there is no need to transpile the module yourself. |
I found the solution to be this: Don't use the built-in version of uglifyjs-webpack-plugin and install the latest version using
Taken from https://stackoverflow.com/questions/45870467/error-in-bundle-js-from-uglifyjs-name-expected |
Ran into this recently after having moved the config files around. Make sure whatever paths you reference in your Webpack config point to the correct directories/files. |
I will recommend something else. I had this issue as well. Took me few days and bunch of research to make some progress. Well only thing that helped in my case was opening main I don't use that library so i can just remove it - I can't say what's the issue but just a tip from me. If anyone will be interested for me this were 2 imports:
|
Do you want to request a feature or report a bug?
Report a bug
What is the current behavior?
A build that succeeds in dev fails when run as a production build.
The specific output I'm getting is:
If the current behavior is a bug, please provide the steps to reproduce.
I've created a gist here.
What is the expected behavior?
The build works in both dev and production
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
This build has failed on both windows and OS X.
The text was updated successfully, but these errors were encountered: