How can I avoid minify Javascript(main.js) on ionic 2 run? - ionic2

I am using this command to run Ionic 2 project on android
ionic run -l -c -s --debug android
after I see such a exception
0 214474 error EXCEPTION: No component factory found for t
1 214477 error ORIGINAL STACKTRACE:
2 214484 error Error: No component factory found for t at e.Error (native)
at e [as constructor] (http://192.158.0.8:8100/build/main.js:5:5464)
The problem is that ionic run compiles everything to minified main.js file and it is nearly impossible to understand exceptions or debug on it.
Is there any way to skip minify step?
Or maybe there is a other solution to debug ionic 2 application?

Related

ng build --prod - Error: Property body expected type of array but got null

I recently made a new branch in my angular project and am working on in for a bit. Now I wanted to build it for testing on smartphones. When using ng build --prod, I get the following error (ng build works tho!)
An unhandled exception occurred:
/Users/r/Documents/.../project/main-es2015.23a6f948094203a25f4a.js:
Property body expected type of array but got null See
"/private/var/folders/c5/y_n4tj316sq9x1nqx20qdlh40000gp/T/ng-FBFvv4/angular-errors.log"
for further details.
The angular-errors.log is not helpfull at all:
[error] TypeError:
/Users/r/Documents/.../project/main-es2015.23a6f948094203a25f4a.js:
Property body expected type of array but got null
at validate (/Users/r/Documents/.../project/node_modules/#babel/types/lib/definitions/utils.js:160:13)
at Object.validate (/Users/r/Documents/.../project/node_modules/#babel/types/lib/definitions/utils.js:229:7)
at validateField (/Users/r/Documents/.../project/node_modules/#babel/types/lib/validators/validate.js:24:9)
at Object.validate (/Users/r/Documents/.../project/node_modules/#babel/types/lib/validators/validate.js:17:3)
at NodePath._replaceWith (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/path/replacement.js:172:7)
at NodePath._remove (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/path/removal.js:57:10)
at NodePath.remove (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/path/removal.js:36:8)
at PluginPass.ForOfStatement (/Users/r/Documents/.../project/node_modules/#babel/plugin-transform-for-of/lib/index.js:206:16)
at newFn (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/visitors.js:175:21)
at NodePath._call (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/path/context.js:55:20)
at NodePath.call (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/path/context.js:42:17)
at NodePath.visit (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/path/context.js:92:31)
at TraversalContext.visitQueue (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/context.js:116:16)
at TraversalContext.visitSingle (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/context.js:88:19)
at TraversalContext.visit (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/context.js:144:19)
at Function.traverse.node (/Users/r/Documents/.../project/node_modules/#babel/traverse/lib/index.js:82:17)
Production Environment.prod.ts looks like this:
export const environment = {
production: true,
VERSION: require('../../package.json').version
};
I tried using the --source-map=true flag, but it is canceling building before its able to write the sourcemap.
I didnt put hands on my package.json since two month, but also tried deleting the node_modules and reinstall them.
I also tried changing rxjs and typescript versions, but no success
Im using angular -v 10.1.6, typescript -v 4.0.3, rxjs -v 6.4.5
What can I do??
Any help appreaciated!
I found a solution here https://github.com/angular/angular-cli/issues/16998.
My problem was using Labels. It appears that babel is having a bug with that.

Can't run ember test

After many successful times running ember test and ember test -s, I can't run either of them on a specific project. The only thing I can think of that happened since it last ran successfully is that Terminal.app crashed while ember test -s was running.
Now when I run ember test -s on that project, I always get this error:
Global error: Error: Assertion Failed: The initializer 'container-debug-adapter' has
already been registered at http://localhost:7357/assets/vendor.js, line 38210
Global error: Error: Assertion Failed: The tests file was not loaded. Make sure your
tests index.html includes "assets/tests.js". at http://localhost:7357/assets/vendor.js, line 38210
Error: Assertion Failed: The initializer 'container-debug-adapter' has already been
registered at http://localhost:7357/assets/vendor.js, line 38210
Error: Assertion Failed: The tests file was not loaded. Make sure your tests
index.html includes "assets/tests.js". at http://localhost:7357/assets/vendor.js, line 38210
If I try running ember test -s on a different project, it works fine. So it seems to me that there must be something untracked by git that is sitting somewhere in the project folder that causes this problem.
Ember: 3.14.1
Ember CLI:
I solved the problem by deleting node_modules and package-lock.json and then running npm install.
I wish that I understood what could cause this and why reinstalling all of my dependencies would fix it.

what is an error "Error: Unexpected token '}' in JSON at position 1923" in ionic 2

I am using Ionic-2 framework. When I install any native plugin in my application it throws the following error in command line.
Error: Unexpected token '}' in JSON at position 1923
I am not getting what is causing this error, now I'm unable to install any plugin.
I had a similar problem:
Error: Unexpected token / in JSON at position 1057
when I issued the command:
ionic plugin add phonegap-plugin-barcodescanner
The reason was I made a mistake by trying to comment a line of "plugins/fetch.json" by "//". Cerntainly, a json file couldn't be commented this way. However, Ionic 2 didn't tell you which file had the problem.
So, please check the json file Ionic might touch during the process, e.g. package.json & plugins/fetch.json
Make sure all the {} pair are matched.
I run into this problem when trying to execute cordova build --release android
Execute cordova plugin rm cordova-plugin-console to solve it.

Ionic2 build demos not working

I want to build the demos from the forked Ionic 2 repository. when I run 'gulp demos.build'
I get the following errors on my terminal:
ERRROR: Command failed: node --max_old_space_size=8096 /Users/luki/Applications/ionic-fork/ionic/node_modules/.bin/ngc -p /Users/luki/Applications/ionic-fork/ionic/demos/tsconfig.json
Error: Error at /Users/luki/Applications/ionic-fork/ionic/node_modules/#types/protractor/index.d.ts:22:27: Module 'webdriver' has no exported member 'IButton'.
Error at /Users/luki/Applications/ionic-fork/ionic/node_modules/#types/protractor/index.d.ts:25:24: Module 'webdriver' has no exported member 'IKey'.
Error at /Users/luki/Applications/ionic-fork/ionic/node_modules/#types/protractor/index.d.ts:28:45: Property 'Error' does not exist on type 'typeof error'.
I installed 'typings install selenium-webdriver but it doesn't help. Maybe some other typings are missing ...
Anybody got a clue about this ?

netbeans cakephp unittest PHP Fatal error: Class 'App' not found in {filename} line 3

I am trying to run unit test from netbeans but it fails with this error.
PHP Fatal error: Class 'App' not found in /home/user/cakephp/app/Test/Case/Model/AceScoreTest.php on line 3
Stack trace:
1. {main}() /usr/bin/phpunit:0
2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46
3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:129
4. PHPUnit_Runner_BaseTestRunner->getTest() /usr/share/php/PHPUnit/TextUI/Command.php:150
5. ReflectionMethod->invoke() /usr/share/php/PHPUnit/Runner/BaseTestRunner.php:124
6. NetBeansSuite::suite() /usr/local/netbeans-7.2.1/php/phpunit/NetBeansSuite.php:0
Unit test works fine when run from the command line as
./cake test app Model/AceScore
What do I need to do to get cakephp unit test to work in Netbeans?
There must be some way to tell phpunit to look for App.php in lib/Cake/Core/App.php
Thanks.
Perhaps, you have to create a bootstrap file for PHPUnit and set it to NetBeans.
I have added new Action (PHPUnit Test Init Action[1]) to CakePHP pluign for NetBeans[2].
If you are using this plugin, please try it ;) Please see [1] about bootstrap file.
[1] https://github.com/junichi11/cakephp-netbeans#phpunit-test-settings-phpunit-test-init-action
[2] http://plugins.netbeans.org/plugin/44579/php-cakephp-framework