Not able to run angular dart app in firefox - dart

Recipebook Angular dart app not working in firefox 28.0 (Mac OSx),App is running fine on chrome and safari.
Stack trace (debug mode) :
"listen ignoreClick=false" main.dart.js:36580
"NoSuchMethodError : method not found: 'Symbol("onHashChange")'
Receiver: Instance of 'UnknownJavaScriptObject'
Arguments: []
STACKTRACE:
.wrapException<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:2687
.Interceptor.noSuchMethod$1<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:380
.Object.get$onHashChange#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:28458
.Router.listen$2$appRoot$ignoreClick<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:39777
.Router.listen$2$appRoot$ignoreClick<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:39788
.NgRoutingHelper.NgRoutingHelper$4<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:15478
.NgRoutingHelper.static.NgRoutingHelper$<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:15485
.JsMethodMirror._invoke$2<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:18740
.JsClassMirror._getInvokedInstance$3<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:18384
.JsClassMirror.newInstance$3<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:18387
.JsClassMirror.newInstance$3<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:18389
.DynamicInjector.newInstanceOf$4<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:36897
._TypeProvider.get$4<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:36863
.Injector__getInstanceByType_closure.call$0<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:36759
._defaultCreationStrategy<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:36604
.Injector._getInstanceByType$2<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:36687
.Injector._getInstanceByType$2<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:36682
.Injector.get$1<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:36710
.NgViewDirective.static.NgViewDirective$<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:15252
.JsMethodMirror._invoke$2<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:18740
.JsClassMirror._getInvokedInstance$3<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:18384
.JsClassMirror.newInstance$3<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:18387
.JsClassMirror.newInstance$3<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:18389
.DynamicInjector.newInstanceOf$4<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:36897
._TypeProvider.get$4<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:36863
.Injector__getInstanceByType_closure.call$0<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:36759
._defaultCreationStrategy<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:36604
.Injector._getInstanceByType$2<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:36687
.Injector.get$1<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:36710
.BlockFactory__instantiateDirectives_closure3.call$1<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:7219
.IterableMixinWorkaround_forEach<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:15864
.JSArray.forEach$1<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:542
J.forEach$1$ax#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:40778
.BlockFactory._instantiateDirectives$5<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:7038
.BlockFactory._link$4<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:6973
.BlockFactory._link$4<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:6975
.BlockFactory._link$4<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:6975
.BlockFactory.call$2<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:6941
.BlockFactory.call$2<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:6946
.BoundBlockFactory.blockFactory$1#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:6913
.BoundBlockFactory.call$1<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:6922
._Case.blockFactory$1#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:14424
.NgSwitchDirective_value_closure0.call$1<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:14406
.IterableMixinWorkaround_forEach<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:15864
.JSArray.forEach$1<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:542
J.forEach$1$ax#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:40778
.NgSwitchDirective.set$value<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:14367
.CachedInvocation.invokeOn$2<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:3759
.JsInstanceMirror._invoke$4<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:17934
.JsInstanceMirror.setField$2<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:17938
.AccessReflective._eval_access$_assign$3<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:10506
.AccessScope.assign$2<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:10332
J.assign$2$x#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:40721
.DynamicExpression.assign$2<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:9665
J.assign$2$x#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:40721
.Compiler_createMappings___closure2.call$1<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:7764
.relaxFnArgs3_closure0.call$3<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:15680
._Watch.fn$3#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:6432
.Scope._digestHandleDirty$5<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:5838
.Scope._digestComputeLastDirty$0<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:5801
.Scope._digestWhileDirtyLoop$0<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:5738
.Scope.$$digest$0<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:5724
.Scope._autoDigestOnTurnDone$0<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:5569
anonymous/<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:2935
._rootRun<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:19282
._ZoneDelegate.run$2<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:21603
.NgZone._finishTurn$2<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:6572
.NgZone._onRunBase$4<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:6544
.NgZone._onRunUnary$5<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:6551
anonymous/<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:2947
._ZoneDelegate.runUnary$3<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:21610
._CustomizedZone.runUnary$2<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:21792
._BaseZone.runUnaryGuarded$2<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:21692
._BaseZone_bindUnaryCallback_closure.call$1<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:21749
.invokeClosure_closure0.call$0<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:3995
._IsolateContext.eval$1<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:1705
._callInIsolate<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:1486
.invokeClosure<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:2828
.convertDartClosureToJS</$function</<#http://localhost:63342/RecipeBookAngularDart/build/main.dart.js:2845
"
Edit :
App is working fine if I include debug version of shadow DOM instead of min version
<script src="packages/shadow_dom/shadow_dom.debug.js"></script>

Related

SQLDelight - java.lang.UnsatisfiedLinkError: couldn't find "libsqlitejdbc.so"

Runtime Environment
SQLDelight version: 1.4.3
Application OS: Android
Bug Description
I'm trying to create SQLDelight in library level as kotlin multiplatform library and deploy it as android library...
Then when I added it as dependencies in my Android apps (separated project, because I want to treat it as client who used my library later), I got a Runtime issue with the following stacktrace :
2020-12-01 10:02:40.827 3642-3642/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.socketdummy, PID: 3642
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.socketdummy-iBZCoVo2j0qCEXnpJ23JAg==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.socketdummy-iBZCoVo2j0qCEXnpJ23JAg==/lib/x86, /system/lib, /system/product/lib]]] couldn't find "libsqlitejdbc.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1067)
at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
at java.lang.System.loadLibrary(System.java:1667)
at org.sqlite.core.NativeDB.<clinit>(NativeDB.java:38)
at org.sqlite.core.NativeDB.load(NativeDB.java:53)
at org.sqlite.core.CoreConnection.open(CoreConnection.java:211)
at org.sqlite.core.CoreConnection.<init>(CoreConnection.java:76)
at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:25)
at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:24)
at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:45)
at org.sqlite.JDBC.createConnection(JDBC.java:114)
at org.sqlite.JDBC.connect(JDBC.java:88)
at java.sql.DriverManager.getConnection(DriverManager.java:580)
at java.sql.DriverManager.getConnection(DriverManager.java:190)
at com.squareup.sqldelight.sqlite.driver.JdbcSqliteDriver.<init>(JdbcSqliteDriver.kt:25)
at com.squareup.sqldelight.sqlite.driver.JdbcSqliteDriver.<init>(JdbcSqliteDriver.kt:14)
at bca.lib.data.local.driver.DatabaseDriverFactory.createDriver(DatabaseDriverFactory.kt:21)
at bca.lib.data.local.driver.DatabaseDriverFactoryKt.getSQLDriver(DatabaseDriverFactory.kt:29)
at bca.lib.di.KodeinInjectorKt$kodeinInjector$1$6.invoke(KodeinInjector.kt:22)
at bca.lib.di.KodeinInjectorKt$kodeinInjector$1$6.invoke(Unknown Source:2)
at org.kodein.di.bindings.Singleton$getFactory$1$1$1.invoke(standardBindings.kt:127)
at org.kodein.di.bindings.Reference$Local$Companion.invoke$kodein_di(references.kt:16)
at org.kodein.di.bindings.Strong$Companion.make(references.kt:31)
at org.kodein.di.bindings.Singleton$getFactory$1$1.invoke(standardBindings.kt:127)
at org.kodein.di.bindings.Singleton$getFactory$1$1.invoke(standardBindings.kt:96)
at org.kodein.di.bindings.StandardScopeRegistry.getOrCreate(scopes.kt:64)
at org.kodein.di.bindings.Singleton$getFactory$1.invoke(standardBindings.kt:127)
at org.kodein.di.bindings.Singleton$getFactory$1.invoke(standardBindings.kt:96)
at org.kodein.di.internal.DIContainerImpl$factory$1.invoke(DIContainerImpl.kt:160)
at org.kodein.di.DIContainer$provider$$inlined$toProvider$1.invoke(curry.kt:14)
at org.kodein.di.internal.DirectDIBaseImpl.Instance(DirectDIImpl.kt:30)
at bca.lib.di.KodeinInjectorKt$kodeinInjector$1$5.invoke(KodeinInjector.kt:25)
at bca.lib.di.KodeinInjectorKt$kodeinInjector$1$5.invoke(Unknown Source:2)
at org.kodein.di.bindings.Singleton$getFactory$1$1$1.invoke(standardBindings.kt:127)
at org.kodein.di.bindings.Reference$Local$Companion.invoke$kodein_di(references.kt:16)
at org.kodein.di.bindings.Strong$Companion.make(references.kt:31)
at org.kodein.di.bindings.Singleton$getFactory$1$1.invoke(standardBindings.kt:127)
at org.kodein.di.bindings.Singleton$getFactory$1$1.invoke(standardBindings.kt:96)
at org.kodein.di.bindings.StandardScopeRegistry.getOrCreate(scopes.kt:64)
at org.kodein.di.bindings.Singleton$getFactory$1.invoke(standardBindings.kt:127)
at org.kodein.di.bindings.Singleton$getFactory$1.invoke(standardBindings.kt:96)
at org.kodein.di.internal.DIContainerImpl$factory$1.invoke(DIContainerImpl.kt:160)
at org.kodein.di.DIContainer$provider$$inlined$toProvider$1.invoke(curry.kt:14)
at org.kodein.di.internal.DirectDIBaseImpl.Instance(DirectDIImpl.kt:30)
at bca.lib.di.KodeinInjectorKt$kodeinInjector$1$4.invoke(KodeinInjector.kt:25)
at bca.lib.di.KodeinInjectorKt$kodeinInjector$1$4.invoke(Unknown Source:2)
at org.kodein.di.bindings.Singleton$getFactory$1$1$1.invoke(standardBindings.kt:127)
at org.kodein.di.bindings.Reference$Local$Companion.invoke$kodein_di(references.kt:16)
2020-12-01 10:02:40.829 3642-3642/? E/AndroidRuntime: at org.kodein.di.bindings.Strong$Companion.make(references.kt:31)
at org.kodein.di.bindings.Singleton$getFactory$1$1.invoke(standardBindings.kt:127)
at org.kodein.di.bindings.Singleton$getFactory$1$1.invoke(standardBindings.kt:96)
at org.kodein.di.bindings.StandardScopeRegistry.getOrCreate(scopes.kt:64)
at org.kodein.di.bindings.Singleton$getFactory$1.invoke(standardBindings.kt:127)
at org.kodein.di.bindings.Singleton$getFactory$1.invoke(standardBindings.kt:96)
at org.kodein.di.internal.DIContainerImpl$factory$1.invoke(DIContainerImpl.kt:160)
at org.kodein.di.DIContainer$provider$$inlined$toProvider$1.invoke(curry.kt:14)
at org.kodein.di.internal.DirectDIBaseImpl.Instance(DirectDIImpl.kt:30)
at bca.lib.di.KodeinInjectorKt$kodeinInjector$1$2.invoke(KodeinInjector.kt:25)
at bca.lib.di.KodeinInjectorKt$kodeinInjector$1$2.invoke(Unknown Source:2)
at org.kodein.di.bindings.Provider$getFactory$1.invoke(standardBindings.kt:86)
at org.kodein.di.bindings.Provider$getFactory$1.invoke(standardBindings.kt:80)
at org.kodein.di.internal.DIContainerImpl$factory$1.invoke(DIContainerImpl.kt:160)
at org.kodein.di.DIContainer$provider$$inlined$toProvider$1.invoke(curry.kt:14)
at org.kodein.di.internal.DirectDIBaseImpl.Instance(DirectDIImpl.kt:30)
at bca.lib.ConnectionManager$connect$provisionUseCase$2.invoke(ConnectionManager.kt:28)
at bca.lib.ConnectionManager$connect$provisionUseCase$2.invoke(ConnectionManager.kt:10)
at org.kodein.di.DIAwareKt$newInstance$1.invoke(DIAware.kt:268)
at org.kodein.di.DIAwareKt$newInstance$1.invoke(Unknown Source:4)
at org.kodein.di.DIProperty$provideDelegate$1.invoke(properties.kt:46)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at bca.lib.ConnectionManager.connect(ConnectionManager.kt:16)
at com.example.socketdummy.MainActivity.lambda$onCreate$0(MainActivity.java:31)
at com.example.socketdummy.-$$Lambda$MainActivity$GO0OJj7ZT4UkfvPtudR0IznuTHw.onClick(Unknown Source:2)
at android.view.View.performClick(View.java:7125)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:992)
at android.view.View.performClickInternal(View.java:7102)
at android.view.View.access$3500(View.java:801)
at android.view.View$PerformClick.run(View.java:27336)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
it said no "libsqlitejdbc.so" was found..., did I make a mistake? and how to solve this problem?
according to the documentation I understand, I just addded this following dependencies in my Android apps :
implementation 'com.squareup.sqldelight:android-driver:1.4.3'
I need solution for this issue with the following conditions:
the SQLDelight definition is on Library layer (including .sq, driver actual definition) and can be deployed as android lib or iOS framework
it can be implemented as dependencies in the client apps later (ex: Android / iOS)
Thank you
Somehow you have included the jdbc driver. See lines in the stack trace related to com.squareup.sqldelight.sqlite.driver.JdbcSqliteDriver. I would guess this either crept in because you intended them to run tests in the JVM that way, or you are also making this library available for server side and the config is not set up properly. Seeing the gradle config might help.

Rejecting re-init on previously failed class error when loading a Class with dalvikvm

I am trying to use Terminal IDE on Lollipop 5.1.1. Using a Samsung E7 device, a mod version of Terminal IDE is provided by someone on XDA
here:
http://forum.xda-developers.com/showthread.php?t=1340852&page=7
I tried to use javac script in that mod but it gave an unsatisfied link error, saying that:
$ javac
java.lang.UnsatisfiedLinkError: org.apache.harmony.security.fortress.Services
at org.apache.harmony.security.fortress.Engine.getServices(Engine.java:158)
at org.apache.harmony.security.fortress.Engine.getInstance(Engine.java:137)
at java.security.cert.CertificateFactory.getInstance(CertificateFactory.java:90)
at
org.apache.harmony.security.utils.JarUtils.verifySignature(JarUtils.java:83)
at java.util.jar.JarVerifier.verifyCertificate(JarVerifier.java:294)
at java.util.jar.JarVerifier.readCertificates(JarVerifier.java:268)
at java.util.jar.JarFile.getInputStream(JarFile.java:380)
at libcore.net.url.JarURLConnectionImpl.getInputStream(JarURLConnectionImpl.java:222)
at java.net.URL.openStream(URL.java:470)
at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:444)
at java.util.ResourceBundle.handleGetBundle(ResourceBundle.java:515)
at java.util.ResourceBundle.handleGetBundle(ResourceBundle.java:542)
at java.util.ResourceBundle.handleGetBundle(ResourceBundle.java:542)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:228)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:139)
at com.sun.tools.javac.main.JavaCompiler.version(JavaCompiler.java:112)
at com.sun.tools.javac.main.JavaCompiler.version(JavaCompiler.java:97)
at com.sun.tools.javac.main.Main.bugMessage(Main.java:434)
at com.sun.tools.javac.main.Main.compile(Main.java:421)
at com.sun.tools.javac.main.Main.compile(Main.java:308)
at com.sun.tools.javac.main.Main.compile(Main.java:299)
at com.sun.tools.javac.Main.compile(Main.java:82)
at com.spartacusrex.spartacuside.external.javac.main(javac.java:13)
$
It is strange that there is a UnsatisfiedLinkError , because it doesn't say that VM cannot find xyz.so library or cannot find xyz method.
I tried using logcat command right after using Terminal IDE's javac script on Device, the odd thing I found from there is :
I/art ( 6558) : rejecting re-init on previously-failed class java.lang.Class<org.apache.harmony.security.fortress.Services>
I couldn't understand why this happened,
The javac script uses android's dalvikvm command to load
com.spartacusrex.spartacuside.external.javac
class. People have faced this rejecting re-init issue on sdk version 20+ but it's not clear to me why this info message uccurs and how to solve it.
I copied /system/lib/libjavacrypto.so to Terminal IDE's ~/system/lib folder and now javac and dx tools are working.
It seems like Google messed up with things in /system/lib which resulted in errors.
Answering so someone else might find it useful.

Polymer app won't load in Safari (pre-1.0)

A load of errors, and my app won't load. True on desktop (OSX El Capitan) and mobile (iOS9).
http://d.pr/i/1lvBa
Errors like:
TypeError: Attempting to change configurable attribute of unconfigurable property.
ReferenceError: Can't find variable: HTMLImports
(anonymous function)
atEndOfMicrotask
TypeError: document.registerElement is not a function. (In 'document.registerElement('polymer-element', {prototype: prototype})', 'document.registerElement' is undefined)
And more...
My Polymer (Dart) version is 0.16.3+3.
I assume you run into this issue https://github.com/dart-lang/polymer-dart/issues/538
It appears that problem is in outdated web_components, i got it all
working on iOS 9 and OSX 10.11 by overriding web_components in my yams
file by adding:
dependency_overrides: web_components: "^0.12.0+3"

Firefox extension - Error: call to Function() blocked by CSP

I have the following simplified code:
main.js:
var data = require("sdk/self").data;
var tabs = require("sdk/tabs");
tabs.on('ready', function(tab) {
console.log("start");
let worker = tab.attach({
contentScriptFile: [
data.url("jquery.min.js"),
data.url("test.js")
],
});
worker.port.emit("start", data.load("popups/start.html"));
console.log("end");
});
test.js:
console.log("test.js");
self.port.on("start", function (content) {
console.log("I get the message");
$('body').append(content);
});
The problem:
This works just fine and everything is ok in most cases. In only one web site and specifically in well known github.com, it produces the following error:
console.log: test: start
console.log: test: end
console.error:
Message: Error: call to Function() blocked by CSP
console.error:
Message: TypeError: this.sandbox is undefined
Stack:
receive#resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/content/worker-child.js:75:7
emitOnObject#resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/event/core.js:112:9
emit#resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/event/core.js:89:38
processMessageReceived#resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/remote/child.js:54:38
Note 1: The problem is with the exchange of the message start. But why it is working everywhere else except the github.com/*?
Note 2: I'm using cfx, with jpm it works fine. Is any way to fix that or I have to update my extension to run with jpm?
cfx is probably including an old version of the SDK while jpm runs with the browser's built-in version. Try running with --strip-sdk.
That said, cfx is deprecated, you should use jpm.
Github uses CSP directives to block unsafe script execution including eval and new Function(), many other sites don't.
Newer SDK versions initialize the addon script sandbox differently so it is not affected by CSPs.

Code from dart2js is throwing NoSuchMethodErrors for get$functions

My Polymer.dart web app, that works fine in Dartium, is giving the following error (it repeats seven times) when compiled with dart2js using pub build --mode=debug and loaded in Chrome.
Resource interpreted as Script but transferred with MIME type text/plain: "http://confab.dev/index.html_bootstrap.dart". confab.dev/:10
warning: file:///home/dan/projects/confabulous/webatara/web/index.html.0.dart library not found index.html_bootstrap.dart.js:17188
Uncaught Error: NoSuchMethodError: Cannot call "get$functions" on "#<JsLibraryMirror>" (Object #<JsLibraryMirror> has no method 'get$functions') index.html_bootstrap.dart.js:17188
Stack Trace:
TypeError: Object #<JsLibraryMirror> has no method 'get$functions'
at dart._loadLibrary (http://confab.dev/index.html_bootstrap.dart.js:20000:19)
at dart._loadLibraries (http://confab.dev/index.html_bootstrap.dart.js:19917:11)
at dart._initPolymerOptimized (http://confab.dev/index.html_bootstrap.dart.js:19908:7)
at dart.initPolymer (http://confab.dev/index.html_bootstrap.dart.js:19902:7)
at main (http://confab.dev/index.html_bootstrap.dart.js:4112:7)
at _IsolateContext.eval$1 (http://confab.dev/index.html_bootstrap.dart.js:1369:23)
at dart.startRootIsolate (http://confab.dev/index.html_bootstrap.dart.js:1145:21)
at http://confab.dev/index.html_bootstrap.dart.js:26514:7
at init.currentScript (http://confab.dev/index.html_bootstrap.dart.js:26494:5)
at http://confab.dev/index.html_bootstrap.dart.js:26508:3
index.html_bootstrap.dart.js:17188
Uncaught NoSuchMethodError: Cannot call "get$functions" on "#<JsLibraryMirror>" (Object #<JsLibraryMirror> has no method 'get$functions') index.html_bootstrap.dart.js:2369
Because source maps don't appear to work (they're turned on in Chrome, and I have .map files), I don't even know which part of my code is causing this.
I've tried with interop.js included both before dart.js, as the docs say, and after, as this issue says.
Looks like a bug in dart2js. Please file an issue, ideally with a reproducible test-case.
pub upgrade fixed it. It turns out that something had replaced the polymer 0.9.5 that I'd been using with 0.8.10+4. Quite odd. The solution to this is to set the polymer version as '>= 0.9.5' instead of 'any', which I will do eventually, but for now I'm interested to see if it happens again.

Resources