-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
--env.uglify breaks app #4574
Comments
@yringler the latest version of
In our next version of |
Before I installed it as dev dependency, I was getting runtime errors, but only when uglification was enabled. I installed it as dev dependency to experiment.
I will definitely try that out. Thrilled that switching to an es6 uglifier! |
…sues/4574#issuecomment-489014600
I tried nativescript-dev-webpack@next and nativescript-dev-webpack@latest on my current master and everything was fine. |
Environment
Output of tns info:
√ Component nativescript has 5.3.4 version and is up to date.
√ Component tns-core-modules has 5.3.1 version and is up to date.
√ Component tns-android has 5.3.1 version and is up to date.
Describe the bug
I observed that my app would often fail suddenly and unexpectedly.
I further observed (edit: before I tried installing uglify as a dev dependency) that this only happen when I passed in --env.uglify.
Later, [edit] after manually installing uglifyjs-webpack-plugin as a dev dependency, which I presume got me the latest version, I started seeing the following error in my builds:
I think these were always errors, just that they weren't being printed in the default bundled version.
I believe this only happened after I updated my webpack/config.
Perhaps it is no longer properly transpiling to es5?
I confirmed that the vendor.js file has multiple occurances of the const keyword.
To Reproduce
Uglification errors (breaks build):
git clone https://github.com/yringler/rabbi-gordon-audio
git checkout 77bbe9b23e0796cf8d53d2a1c31ec9ff1a00d3c3
tns run android --bundle --env.uglify
App runs, with errors:
git clone https://github.com/yringler/rabbi-gordon-audio
git checkout f2af3f495d229b38cdd1e3bd7d48089a61708d2e
tns run android --bundle --env.uglify
The app should crash. Cancel, then run again should show errors.
Expected behavior
Uglification should not make the app unstable.
Sample project
https://github.com/yringler/rabbi-gordon-audio
Additional context
I'm using angular.
On master, I "refreshed", copying over my code to a clean tns app. This "clean" app, with some older versions, seems to work fine.
I tried updating from there on a new branch(https://github.com/yringler/rabbi-gordon-audio/tree/17-try-upgrade), but am again getting errors.
I'm still investigating exact replication.
Here is a sample log with error which occurs when run with uglification
The text was updated successfully, but these errors were encountered: