Note that there are some explanatory texts on larger screens.

plurals
  1. POjs interop compiled with dart2js error - Uncaught NoSuchMethodError : method not found:
    primarykey
    data
    text
    <p>I generated a sample Polymer web project. Added following js file.</p> <p>jslib.js</p> <pre class="lang-dart prettyprint-override"><code>function testfunction() { alert("test"); } </code></pre> <p>in clickcounter.dart I added dependency</p> <pre class="lang-dart prettyprint-override"><code>import 'package:js/js.dart' as js; </code></pre> <p>and changed increment() function</p> <pre class="lang-dart prettyprint-override"><code>void increment() { js.context.testfunction(); count++; } </code></pre> <p>In clickcounter.html added js file import</p> <pre class="lang-dart prettyprint-override"><code>&lt;script src="jslib.js" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>And in main html file added</p> <pre class="lang-dart prettyprint-override"><code>&lt;script src="packages/browser/interop.js"&gt;&lt;/script&gt; </code></pre> <p>It works correctly when in executed in Dartium. When I compile it to javascript however it gives an error </p> <pre class="lang-dart prettyprint-override"><code>Uncaught NoSuchMethodError : method not found: 'Symbol("testfunction")' Receiver: Instance of 'Proxy' Arguments: [] js_helper.dart:870 Stack Trace: Error at Object.wrapException (http://127.0.0.1:3030/testrun/out/web/testrun.html_bootstrap.dart.js:4632:13) at Proxy.Object.noSuchMethod$1 (http://127.0.0.1:3030/testrun/out/web/testrun.html_bootstrap.dart.js:33708:13) at Proxy_noSuchMethod_closure.call$0 (http://127.0.0.1:3030/testrun/out/web/testrun.html_bootstrap.dart.js:109612:46) at Object.Proxy.static.Proxy__forward (http://127.0.0.1:3030/testrun/out/web/testrun.html_bootstrap.dart.js:109581:45) at Proxy.noSuchMethod$1 (http://127.0.0.1:3030/testrun/out/web/testrun.html_bootstrap.dart.js:109492:14) at Proxy.Object.testfunction$0 (http://127.0.0.1:3030/testrun/out/web/testrun.html_bootstrap.dart.js:56090:17) at ClickCounter.increment$0 (http://127.0.0.1:3030/testrun/out/web/testrun.html_bootstrap.dart.js:7080:50) at CachedInvocation.invokeOn$2 (http://127.0.0.1:3030/testrun/out/web/testrun.html_bootstrap.dart.js:6221:28) at JsInstanceMirror._invoke$4 (http://127.0.0.1:3030/testrun/out/web/testrun.html_bootstrap.dart.js:12998:35) at JsInstanceMirror.invoke$3 (http://127.0.0.1:3030/testrun/out/web/testrun.html_bootstrap.dart.js:12963:17) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload