What is causing this Polymer.dart to misbehave in Safari versus Chrome? - dart

The (post pub build) app is at http://mycommunity.org.
Look at the console in both Safari and Chrome. In the former, there's:
[Error] Element name could not be inferred.
b (polymer.js, line 12)
(anonymous function) (mycommunity.org, line 5709)
[Error] Element name could not be inferred.
b (polymer.js, line 12)
(anonymous function) (mycommunity.org, line 5917)
[Error] Element name could not be inferred.
b (polymer.js, line 12)
[Log] +WovenApp (index.html_bootstrap.dart.js, line 8353)
[Log] +AddStuff (index.html_bootstrap.dart.js, line 8353)
[Log] +InboxList (index.html_bootstrap.dart.js, line 8353)
[Error] SyntaxError: DOM Exception 12: An invalid or illegal string was specified. (platform.js, line 13)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (current-user, line 0)
[Error] TypeError: 'null' is not an object (evaluating 'String(a.constructor).match(/^\s*function\s*(\S*)\s*\(/)[1]') (index.html_bootstrap.dart.js, line 1283)

Wow, the culprit was this line which I now commented out. (I'm not even sure what the exact issue is with that line yet.)
https://github.com/DaveNotik/dart-stack/commit/5131fb225d068e23435759913f72d5346d4efc70#diff-53e52681924d78ddb4512d6f988c91cbR85
Hide yo kids, hide yo wives, your whole Polymer app can break without much notice and only after dart2js. Good ol' Git, I reset to the commit where it worked and identified the commit where it suddenly didn't and went through line by line.

Related

Vaadin 23 TypeError: error loading dynamically imported module

In Firefox browser, not always (but very often) I see the following error in the console (and page is unable to load):
TypeError: error loading dynamically imported module
Only after Ctrl + F5 the page is loaded correctly.
Also in the Network tab I may see the following:
Uncaught (in promise) TypeError: error loading dynamically imported module router.js:525:10
ready router.js:525
(Async: promise callback)
render router.js:517
__onNavigationEvent router.js:932
setRoutes router.js:419
index.ts:32
There is no any other information. In Chrome, everything works fine. What may be the reason of this issue?
I noticed this after upgrade to Vaadin 23.2.1
Also, from time to time I have the following error:

Dart number_format.dart suddenly won't compile

I made a small change in my server code not related to formatting numbers and now the dart library number_format.dart won't compile giving me 12 errors and two warnings. number_format is in intl as noted in the comments and the first error is at line 106. Some or most of the other errors appear to cascade from a first error.
Does anyone know how I may resolve this? I presume I need to edit something in my yaml file.
EDIT
If I choose Tools-> Pub Upgrade then I get the pre-build Problems below This weekend I could choose Tools->Pub Build - Debug but at the moment this does not work. Deleting .pub and following Günter Zöchbauer's suggestion allowed me to do a build Sunday - I hope is still does.
Pre-build Problems output:
Errors:
Line 106: Expected an identifier
Line 106: Expected to find ':'
Line 106: Unexpected token '?'
Line 131: Unexpected token '?'
Line 132: Expected an identifier
Line 132: Expected to find ':'
Line 233: Expected an identifier
Line 233: Expected to find ':'
Line 233: Unexpected token '?'
Line 545: Expected an identifier
Line 545: Expected to find ':'
Line 545: Unexpected token '?'
Warnings:
Line 106: Conditions must have a static type of 'bool'
Line 545: Conditions must have a static type of 'bool'
Hint:
Line 425: When compiled to JS, this test might return true when the left hand side is an int
Thanks

How change yeoman generator-webapp settings to make uploadble files

I begin to use yeoman to make web pages. I finished almost. And I typed 'grunt' not 'grunt serve' to make up-loadable files.
terminal said errors below.But Cords work.
what should I fix.
app/scripts/main.js
2:3 error Strings must use singlequote quotes
2:3 error Expected indentation of 4 space characters but found 2 indent
5:7 error "slideqty" is defined but never used no-unused-vars
50:5 error "map" is defined but never used no-unused-vars
52:1 error Expected indentation of 2 space characters but found 0 indent
55:17 error "google" is not defined no-undef
58:13 error "google" is not defined no-undef
62:1 error "google" is not defined no-undef
62:1 error Expected indentation of 2 space characters but found 0 indent
✖ 22 problems (22 errors, 0 warnings)
Warning: Task "eslint:target" failed. Use --force to continue.
Aborted due to warnings.

Which way to go with these bugs

Compiling Dart app to js these two errors arise:
Nº1:
InvalidStateError: Failed to call 'register' on 'Document' for type 'polymer-element': a type with that name is already registered.
Nº2:
Breaking on exception: TypeError: Object #<qE> has no method 'vL'
The object qE is created by dart2js.
How to find the solution?
There are appropriate tools to find the solution?
Thanks for advance !
I heard N1 occurs when Angular and Polymer is used in the same app. This is a known bug.
related open issues:
- duplicate polymer-element registration should not break the app
- Get error "Uncaught InvalidStateError: Failed to call 'register' on 'Document' for type 'polymer-element'
For the N2 use pub build --mode=debug so you get unmangled names and then use one of the available strategies to fix the problem (use of MirrorsUsed, #observable, #reflectable)

Console error with example of ui.bootstrap.datepicker

I try to use angular-ui-bootstrap datepicker and it upset me for a while with an error on firebug console (Firefox 21) saying
Error: array is undefined
indexOf#http://localhost:9000/components/angular/angular.js:526
arrayRemove#http://localhost:9000/components/angular/angular.js:535
JQLiteUnbind#http://localhost:9000/components/angular/angular.js:1630
JQLite.prototype[name]#http://localhost:9000/components/angular/angular.js:2203
.link/<#http://localhost:9000/components/angular-ui-bootstrap-bower/ui-bootstrap-tpls.min.js:1
Scope.prototype.$digest#http://localhost:9000/components/angular/angular.js:7942
Scope.prototype.$apply#http://localhost:9000/components/angular/angular.js:8143
done#http://localhost:9000/components/angular/angular.js:9170
completeRequest#http://localhost:9000/components/angular/angular.js:9333
createHttpBackend/</xhr.onreadystatechange#http://localhost:9000/components/angular/angular.js:9304
http://localhost:9000/components/angular/angular.js
Line 5754
After I check every datepicker settings I check the given example in documentation, followed the link "edit it on plunker" and I got a similar error.
Error: array is undefined
indexOf#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:510
arrayRemove#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:519
JQLiteUnbind#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:1596
JQLite.prototype[name]#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:2149
.link/<#http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.5.0.js:1229
Scope.prototype.$digest#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:7878
Scope.prototype.$apply#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:8079
bootstrap/<#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:962
invoke#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:2843
bootstrap#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:961
angularInit#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:936
#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:14729
trigger#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:1723
createEventHandler/eventHandler/<#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:1958
forEach#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:133
createEventHandler/eventHandler#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:1957
http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js
Line 5687
Then I try Chrome Version 26.0.1410.63 and I got a different error
TypeError: Cannot read property 'indexOf' of undefined
at indexOf (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:510:12)
at arrayRemove (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:519:15)
at JQLiteUnbind (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:1596:7)
at Object.JQLite.(anonymous function) [as unbind] (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:2149:17)
at Object.fn (http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.5.0.js:1229:21)
at Object.Scope.$digest (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:7878:27)
at Object.Scope.$apply (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:8079:24)
at http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:962:13
at Object.invoke (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:2843:25)
at bootstrap (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:960:12)
It works but the error message upset me a lot and I thought that was something wrong with my code.
Can I assume this is not related with example given but with some internals or is the example missing something?
ui-bootstrap 0.5.0 has a bug,
(it tries to unbind 'focus' event handler, but handler doesn't exist)
https://github.com/angular-ui/bootstrap/blob/gh-pages/ui-bootstrap-tpls-0.5.0.js#L1226
you can apply this changes
https://github.com/angular-ui/bootstrap/commit/bf30898da27272df75f6c7ff26545ed16ebf1978
or build it directly from github
or wait for 0.6.0

Resources