Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Production build failing on uglify step #797

Closed
waywardz opened this issue Apr 11, 2017 · 21 comments
Closed

Production build failing on uglify step #797

waywardz opened this issue Apr 11, 2017 · 21 comments
Assignees

Comments

@waywardz
Copy link

I'm submitting a bug report

  • Aurelia Skeleton Version
    skeleton-esnext-webpack

  • Framework Version:
    1.1.2

Please tell us about your environment:

  • Operating System:
    Windows 10

  • Node Version:
    v6.9.1

  • NPM Version:
    3.10.9

  • JSPM OR Webpack AND Version
    webpack 2.3.3

  • Browser:
    all

  • Language:
    ESNext

Current behavior:
Failure when running npm start webpack.build.production
ERROR in app.5a98142caef70fba3614.bundle.js from UglifyJs Unexpected token: name (App) [app.5a98142caef70fba3614.bundle.js:18328,16]

Expected/desired behavior:
Bundled code without failures

@JoshuaVSherman
Copy link

JoshuaVSherman commented Apr 11, 2017 via email

@waywardz
Copy link
Author

I was able to work around this by updating package-scripts.js to not use the -p flag when doing a production build and adding the babili plugin to the webpack plugins.

...when(production, new BabiliPlugin())

@JoshuaVSherman
Copy link

JoshuaVSherman commented Apr 11, 2017 via email

@waywardz
Copy link
Author

@JoshuaVSherman I hadn't seen that, trying it out now, thanks for the quick response.

@waywardz
Copy link
Author

@JoshuaVSherman Looks like it's working. I tested against the latest version of the esnext-webpack skeleton, it has 11. Do you have a link to the thread? I don't see it logged anywhere and didn't find it in the gitter.

@JoshuaVSherman
Copy link

JoshuaVSherman commented Apr 11, 2017 via email

@niieani
Copy link
Contributor

niieani commented Apr 11, 2017

I did fix this here: 4f2e6b1. If it's still not working, let me know.
The proper fix was to add an uglify target when building for production, not to change the browser target to "not ie <= 10".

@davinthesmith
Copy link

I just downloaded the latest skeleton and the problem persists. Uglify fails during npm start -- build.

Windows 10
Node 6.10.2

@JoshuaVSherman
Copy link

JoshuaVSherman commented Apr 12, 2017 via email

@waywardz
Copy link
Author

@niieani Confirming it's still not working after the fix.

@niieani
Copy link
Contributor

niieani commented Apr 12, 2017

Must be something Windows-specific :/ @Vheissu would you mind taking a look at this? Maybe the environment variable 'production' is not being set in Windows?

@zoltanbedi
Copy link
Contributor

Windows 10
node 7.8.0
npm 4.2.0
yarn 0.22.0
installed the packages with yarn
npm start -- build builds without any error

@JoshuaVSherman
Copy link

if anyone wants to take a look, i have it working now with polymer and it supports browsers
firefox, chrome, safari and IE 11
https://github.com/WebJamApps/combined-front

@waywardz
Copy link
Author

Maybe along the same lines, when I run
npm start e2e.protractor
I see the following error
Error: Error: [BABEL] D:\test2\skeleton-navigation\skeleton-esnext-webpack\test\e2e\demo.e2e.js: Invalid version passed for target "node": "current.0.0". Versions must be in semver format (major.minor.patch)

in .babelrc.js, it's set to
"node": ["current"]
but I would guess it should actually be set as 'node' by
process.env.babelTarget === 'node'

If I change to
"node": ["6.9.1"]
then it works.

This seems to support the argument that the values aren't being set or aren't available.

@waywardz
Copy link
Author

waywardz commented Apr 12, 2017

Actually, seems unrelated, I think...added this into .babelrc.js and I see process.env.production set and process.env.babelTarget as undefined

console.log('production ' + process.env.production); -> true
console.log('babelTarget ' + process.env.babelTarget); -> undefined

@waywardz
Copy link
Author

@JoshuaVSherman Upgrade to 7.9.0, still the same issue with uglify

@niieani
Copy link
Contributor

niieani commented Apr 12, 2017

@waywardz it actually should be "node": "current" (without the array). I'll correct the problem and investigate the main issue.

@niieani
Copy link
Contributor

niieani commented Apr 12, 2017

The Windows-based CI seems to be running the build task (with uglify step) properly. Can any of you verify that it works now?

@JoshuaVSherman
Copy link

JoshuaVSherman commented Apr 12, 2017 via email

@niieani
Copy link
Contributor

niieani commented Apr 12, 2017

@JoshuaVSherman no, you don't, it's done for you automatically. That's the point of 'current'.

@waywardz
Copy link
Author

I missed your comment on verifying, I will try and do this today @niieani

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants