aurelia / skeleton-navigation

Starter kits for building a standard navigation-style app with Aurelia.
Creative Commons Zero v1.0 Universal
732 stars 512 forks source link

Production build failing on uglify step #797

Closed waywardz closed 7 years ago

waywardz commented 7 years ago

I'm submitting a bug report

Please tell us about your environment:

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 commented 7 years ago

change the babelrc two lines

"not ie <= 11"

to be

"not ie <= 10"

or you can upgrade to the new skeleton

On Tue, Apr 11, 2017 at 1:39 PM, waywardz notifications@github.com wrote:

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

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/aurelia/skeleton-navigation/issues/797, or mute the thread https://github.com/notifications/unsubscribe-auth/AMuN2PxSTA_WoUoM2tVyxnUP7BbIo-4oks5ru7rKgaJpZM4M6a9N .

-- Josh Sherman www.joshandmariamusic.com

waywardz commented 7 years ago

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 commented 7 years ago

yeah, i was going to look into babili also, but that fix was there in the github if you look close enough to one of the discussion threads

On Tue, Apr 11, 2017 at 1:41 PM, waywardz notifications@github.com wrote:

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())

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aurelia/skeleton-navigation/issues/797#issuecomment-293340877, or mute the thread https://github.com/notifications/unsubscribe-auth/AMuN2AXsjeYxUvveocp2N5GUc9TLRBB-ks5ru7swgaJpZM4M6a9N .

-- Josh Sherman www.joshandmariamusic.com

waywardz commented 7 years ago

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

waywardz commented 7 years ago

@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 commented 7 years ago

https://github.com/aurelia/skeleton-navigation/issues/786

On Tue, Apr 11, 2017 at 1:49 PM, waywardz notifications@github.com wrote:

@JoshuaVSherman https://github.com/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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aurelia/skeleton-navigation/issues/797#issuecomment-293343853, or mute the thread https://github.com/notifications/unsubscribe-auth/AMuN2ODlYamqWiHPc0yZXNWjJHzuQ4epks5ru70zgaJpZM4M6a9N .

-- Josh Sherman www.joshandmariamusic.com

niieani commented 7 years ago

I did fix this here: https://github.com/aurelia/skeleton-navigation/commit/4f2e6b136567d511c6e7a1140024d67661eea2b3. 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 commented 7 years ago

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

Windows 10 Node 6.10.2

JoshuaVSherman commented 7 years ago

Try upgrade to node 7.8.0 maybe

On Apr 11, 2017 9:48 PM, "Davin Smith" notifications@github.com wrote:

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

Windows 10 Node 6.10.2

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aurelia/skeleton-navigation/issues/797#issuecomment-293449108, or mute the thread https://github.com/notifications/unsubscribe-auth/AMuN2AWpSlbsOvr5fgCk6XkfcMRPg1P-ks5rvC16gaJpZM4M6a9N .

waywardz commented 7 years ago

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

niieani commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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

niieani commented 7 years ago

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

niieani commented 7 years ago

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 commented 7 years ago

You need to replace 'current' with your actual node version in the babelrc

On Apr 12, 2017 12:46 PM, "waywardz" notifications@github.com wrote:

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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aurelia/skeleton-navigation/issues/797#issuecomment-293639117, or mute the thread https://github.com/notifications/unsubscribe-auth/AMuN2FcrX70A0OMwUfnJ60C8-QPtqk9_ks5rvP_lgaJpZM4M6a9N .

niieani commented 7 years ago

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

waywardz commented 7 years ago

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