0

I am using Angular-Dart 4.0 with the "dart_to_js_script_rewriter" and angular transformers configured in pubspec.yaml, but testing with Dartium. pub serve works well except that:

I have found out that an error message such as

Failed to load source asset my_project|lib/src/foo_component.html___jb_tmp___: 
Could not find asset my_project|lib/src/foo_component.html___jb_tmp___.

means that I have some kind of error in that file and it could not be compiled.

However the actual error in my template (like a tag which angular doesn't know...) or in the CSS (bad selector) is not reported in pub's output (not even with -v switch) and also not in Dartium console (which makes sense, since the file isn't served to the Browser).

Is there a way to view such errors or do a validity check on the Angular templates and CSS?

Robert Jack Will
  • 10,333
  • 1
  • 21
  • 29
  • 1
    I made the experience that often when there are no proper error messages, that killing `pub serve` helped. It often shows errors when it fails on initial load that it doesn't show on reload. It's sad, but the Dart team is working on a new build system for the web anyway. – Günter Zöchbauer Oct 30 '17 at 18:31

1 Answers1

2

I think the issue here is that pub serve sees the temp file get added but by the time angular tries to actually read it, it doesn't exist any longer.

The easiest workaround is to disable the safe write feature in intellij, see the steps here.

Jake MacDonald
  • 1,348
  • 6
  • 7
  • Oh, "jb" in {___jb_tmp___} is for "JetBrains" and neither Dart nor Angular have to do with those files! This explains what I found out in the meanwhile, namely that the error is not related to actual errors I have in my template. Angular eats even badly broken HTML in the templates without throwing an error. – Robert Jack Will Nov 09 '17 at 18:40