Sencha touch production build errors - javascript

Using touch 2.1.0 and Cmd 3.1.2.342
Whilst trying to create a production version of my sencha app, I get the following error:
[WRN] C1003: Unsupported Ext.define syntax -- C:\wamp\www\touch-2.1.0\axis\nativ
e\appname\touch\src\fx\TimingFunctions.js:109
[ERR] C2008: Requirement had no matching files (Ext.fx.TimingFunctions) -- C:\wa
mp\www\touch-2.1.0\axis\native\appname\touch\src\fx\Abstract.js:959
[ERR] The following error occurred while executing this line:
C:\wamp\www\touch-2.1.0\axis\native\appname.sencha\app\build-impl.xml:165:
It seems to me that it is saying a file called fx/TimingFunctions.js is required by fx/Abstract.js but cannot be found. However, this can't be what it means as the file exists in that folder.
The command I am using is:
sencha app build production
Line 109 of TimingFunctions.js looks like this:
Ext.define('Ext.fx.TimingFunctions', Ext.apply({
singleton: true,...
One solution is to change line 109 of TimingFunctions.js from:
Ext.define('Ext.fx.TimingFunctions', Ext.apply({
to:
Ext.define('Ext.fx.TimingFunctions', {
and change line 136 of the same file from:
}, EasingPrototype));
to:
}, EasingPrototype);
This then allows the build to go ahead.
However, when I then view the production app in the web browser, it freezes and I get the following error
Uncaught TypeError: Object # has no method 'call' process sencha-touch-all-debug.js:6767
(anonymous function) process sencha-touch-all-debug.js:6774
(anonymous function) sencha-touch-all-debug.js:6779
Ext.apply.onBeforeCreated sencha-touch-all-debug.js:5196
process sencha-touch-all-debug.js:5262
process sencha-touch-all-debug.js:5268
process sencha-touch-all-debug.js:5268
process sencha-touch-all-debug.js:5268
Ext.apply.process sencha-touch-all-debug.js:5272
Ext.Class.ExtClass sencha-touch-all-debug.js:5183
Ext.ClassManager.create sencha-touch-all-debug.js:6725
Ext.apply.define sencha-touch-all-debug.js:7407
(anonymous function) TimingFunctions.js?_dc=1379403994382:109
(anonymous function) TimingFunctions.js?_dc=1379403994382:138

There was a spelling mistake in the files fx/Abstract.js and fx/TimingFunctions.js
Actually, it's not a spelling mistake - more like a grammatical error.
Abstract.js calls a function in TimingFunctions.js. in Abstract.js it is referred to as EasingMap, where as in TimingFunctions.js it is called easingMap

Related

cannot see a variable from Chrome Console but it's accessible in code

Why is a variable accessible from inside a method but not from the browser console?
I have the following typescript code, using angular6, run via ng serve on Windows 10, current Chrome.
import * as d3 from "d3"; // from "npm i d3 --save" version 5.7
// picking a member of d3, nothing magical about "scaleLinear" here
console.log("see", d3.scaleLinear) // it prints ok, ƒ linear() {...
// angular component code fragment below
somefunction() {
console.log("see again", d3.scaleLinear) // it prints ok, again
// add a break here
}
I drive the code to that somefunction. At break, in Chrome console when I try:
> console.log(d3.scaleLinear)
it throws an error:
VM2012:1 Uncaught ReferenceError: d3 is not defined
at eval (eval at push../src/app/user-sel/user-sel.component.ts.UserSelComponent._resyncYSel (user-sel.component.ts:58), <anonymous>:1:13)
at UserSelComponent.push../src/app/user-sel/user-sel.component.ts.UserSelComponent._resyncYSel (user-sel.component.ts:58)
at UserSelComponent.push../src/app/user-sel/user-sel.component.ts.UserSelComponent.selYSel (user-sel.component.ts:166)
at Object.eval [as handleEvent] (UserSelComponent.html:75)
at handleEvent (core.js:21673)
at callWithDebugContext (core.js:22767)
at Object.debugHandleEvent [as handleEvent] (core.js:22470)
at dispatchEvent (core.js:19122)
at core.js:19569
at HTMLSpanElement.<anonymous> (platform-browser.js:993)
How can I access d3 in console directly? What did I miss? I looked at old SO questions on this topic 52332640 but could not find a conclusive answer.
If your pages have any frames, your console could be running in the wrong context.
There is a dropdown that will allow you to specify the correct context
For example, in this screenshot, there are two IFrame elements. In order to access variables from scripts running in "contentIframe2" I have to switch the context

Angular 5 issue with 'removeEventListener' on 'EventTarget' only on prod build. but No issues on Dev build

The Console shows this
main.598d68d658cf204b66cd.bundle.js:1 ERROR TypeError: Failed to execute 'removeEventListener' on 'EventTarget': The callback provided as parameter 2 is not a function.
at r.(anonymous function).XMLHttpRequest.t.responseBlob.o.function.a.(anonymous function).r.(anonymous function).(anonymous function) [as __zone_symbol__open] (https://salty-fjord-85026.herokuapp.com/polyfills.62d8ac97edff2dddd48f.bundle.js:1:132920)
at https://salty-fjord-85026.herokuapp.com/polyfills.62d8ac97edff2dddd48f.bundle.js:1:142082
at r.(anonymous function).i.(anonymous function) [as open] (https://salty-fjord-85026.herokuapp.com/polyfills.62d8ac97edff2dddd48f.bundle.js:1:133379)
at t._subscribe (https://salty-fjord-85026.herokuapp.com/main.598d68d658cf204b66cd.bundle.js:1:647355)
at t._trySubscribe (https://salty-fjord-85026.herokuapp.com/main.598d68d658cf204b66cd.bundle.js:1:98272)
at t.subscribe (https://salty-fjord-85026.herokuapp.com/main.598d68d658cf204b66cd.bundle.js:1:98101)
at e.a (https://salty-fjord-85026.herokuapp.com/main.598d68d658cf204b66cd.bundle.js:1:695746)
at e._innerSub (https://salty-fjord-85026.herokuapp.com/main.598d68d658cf204b66cd.bundle.js:1:718260)
at e._tryNext (https://salty-fjord-85026.herokuapp.com/main.598d68d658cf204b66cd.bundle.js:1:718184)
at e._next (https://salty-fjord-85026.herokuapp.com/main.598d68d658cf204b66cd.bundle.js:1:718007)
but deployment was successful
you can visit the site dev server here
you can look at the code here github
and get in depth understanding of the issue.
thank you all in Advanced

ReactNativeJS: C++ Exception in 'nativeRequireModuleConfig'

I have a fully function react native app for iOS. I tried making android version as well. When i tried to run it on simulator it throw the following error :
E/ReactNativeJS: C++ Exception in 'nativeRequireModuleConfig': java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar)
Gradle console :
AGPBI: {"kind":"error","text":"Error converting bytecode to dex:\nCause: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/iid/MessengerCompat$1;","sources":[{}],"original":"UNEXPECTED TOP-LEVEL EXCEPTION:\ncom.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/iid/MessengerCompat$1;\n\tat com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)\n\tat com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)\n\tat com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)\n\tat com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)\n\tat com.android.dx.merge.DexMerger.merge(DexMerger.java:189)\n\tat com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)\n\tat com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)\n\tat com.android.dx.command.dexer.Main.run(Main.java:277)\n\tat com.android.dx.command.dexer.Main.main(Main.java:245)\n\tat com.android.dx.command.Main.main(Main.java:106)\n","tool":"Dex"}
:app:transformClassesWithDexForDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 2 mins 19.746 secs
I'm using following modules in my project :
Any solutions please?
UPDATE:
Logcat from Real Device :
E/AndroidRuntime: FATAL EXCEPTION: mqt_js
Process: com.opencampus, PID: 10821
java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'com.google.android.gms.iid.zzd' appears in /data/data/com.opencampus/files/instant-run/dex/slice-com.google.android.gms-play-services-gcm-8.1.0_4d535f5b5c1f36628a96d503891e7dd5c3b4eb8f-classes.dex)
at com.google.android.gms.iid.zzd.zzdo(Unknown Source)
at com.google.android.gms.iid.zzd.<init>(Unknown Source)
at com.google.android.gms.iid.zzd.<init>(Unknown Source)
at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
at com.learnium.RNDeviceInfo.RNDeviceModule.getConstants(RNDeviceModule.java:83)
at com.facebook.react.cxxbridge.JavaModuleWrapper.getConstants(JavaModuleWrapper.java:130)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
at android.os.Looper.loop(Looper.java:158)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
at java.lang.Thread.run(Thread.java:818)

Unhandled rejection TypeError: this.emitter.refreshFiles is not a function

Im currently testing my angular app, it's using angular (1.5) + typescript(^1.8.0) + karma (^0.13.14);
I've got the following error when trying to run karma:
"Unhandled rejection TypeError: this.emitter.refreshFiles is not a
function
at Plugin.notifyKarmaAboutChanges (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/karma-webpack-with-fast-source-maps/index.js:148:15)
at Plugin. (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/karma-webpack-with-fast-source-maps/index.js:104:9)
at Compiler.applyPlugins (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/node_modules/tapable/lib/Tapable.js:25:14)
at Watching._done (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/lib/Compiler.js:93:17)
at Watching. (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/lib/Compiler.js:76:18)
at Compiler.emitRecords (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/lib/Compiler.js:319:37)
at Watching. (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/lib/Compiler.js:59:19)
at /Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/lib/Compiler.js:312:11
at Compiler.applyPluginsAsync (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/node_modules/tapable/lib/Tapable.js:73:70)
at Compiler.afterEmit (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/lib/Compiler.js:309:8)
at Compiler. (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/lib/Compiler.js:304:14)
at /Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/node_modules/async/lib/async.js:52:16
at Object.async.forEachOf.async.eachOf (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/node_modules/async/lib/async.js:236:30)
at Object.async.forEach.async.each (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/node_modules/async/lib/async.js:209:22)
at Compiler.emitFiles (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/lib/Compiler.js:272:20)
at MemoryFileSystem.(anonymous function) [as mkdirp] (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/karma-webpack-with-fast-source-maps/node_modules/webpack-dev-middleware/node_modules/memory-fs/lib/MemoryFileSystem.js:283:10)"
So I can only restart karma to run my test again instead of letting karma to auto refresh for me. Can't find similar issue on stackoverflow, so I post my issue here. Any suggestions?

Updated to Angular 1.3.0 no longer working

I am using Browserify to wrap everything up. I have just upgraded from 1.2.23 to 1.3.0 and am now getting the following errors:
Firefox Error
TypeError: angular.module is not a function
var app = angular.module('login-Controller', ['Views']);
----------^
Clearly says that angular is not defined. So I outputed the output from angular
var angular = require('angular'),
console.info(angular); // Object {} ='s an empty object
Does this mean that angular is no longer compatible with browserify? If it is, how can I get it working?
Detailed Error from Chrome
Uncaught TypeError: undefined is not a function main.js:25868 C:\var\www\stage.mayfieldafc.com\src\site\js\users\loginCntrl.js.angularmain.js:1 smain.js:1 (anonymous function)main.js:28 ./src/site/js/app.js.angularmain.js:1 smain.js:1 emain.js:1 (anonymous function)
main.js:183 Uncaught Error: [$injector:modulerr] Failed to instantiate module mays due to:
Error: [$injector:nomod] Module 'mays' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.3.0/$injector/nomod?p0=mays
at http://localhost:3000/js/main.js:183:12
at http://localhost:3000/js/main.js:1900:17
at ensure (http://localhost:3000/js/main.js:1824:38)
at module (http://localhost:3000/js/main.js:1898:14)
at http://localhost:3000/js/main.js:4167:22
at forEach (http://localhost:3000/js/main.js:438:20)
at loadModules (http://localhost:3000/js/main.js:4151:5)
at createInjector (http://localhost:3000/js/main.js:4077:11)
at doBootstrap (http://localhost:3000/js/main.js:1587:20)
at bootstrap (http://localhost:3000/js/main.js:1608:12)
http://errors.angularjs.org/1.3.0/$injector/modulerr?p0=mays&p1=Error%3A%20…at%20bootstrap%20(http%3A%2F%2Flocalhost%3A3000%2Fjs%2Fmain.js%3A1608%3A12)main.js:183 (anonymous function)main.js:4190 (anonymous function)main.js:438 forEachmain.js:4151 loadModulesmain.js:4077 createInjectormain.js:1587 doBootstrapmain.js:1608 bootstrapmain.js:1502 angularInitmain.js:25682 (anonymous function)main.js:2845 triggermain.js:3116 eventHandler
Markup
html(ng-app='mays)
As mentioned by #JeffB, you can use browserify-shim to (hopefully temporarily) remedy this problem.
First, npm install --save-dev browserify-shim. Then, add the following to your package.json:
"browserify": {
"transform": [
"browserify-shim"
]
},
"browser": {
"angular": "./node_modules/angular/angular.js"
},
"browserify-shim": {
"angular": "angular"
}
This should then let you require and access Angular as expected.
The problem is that angular haven't updated their npm packages to be compatible with browserify just yet.
My fix was disgusting but its working. I simply downloaded v1.3.0 and pasted it into:
node_modules\angular\lib\angular.min.js
Now browserify will compile and use the latest version. This I hope is a temporary fix until they update the package.
It looks like you're defining the module name to be 'login-Controller' in your script, but calling it 'mays' in your markup. I would expect to see something like this:
//declare app in main.js
angular.module('name-of-app', [<modules>])
<!-- call your app in markup -->
<html ng-app="name-of-app"></html>
//jade
html(ng-app='name-of-app')

Categories