2

I have a polymer 0.10+ web app that works in Dartium (Dart VM) and worked until Polymer 0.10.0-pre.12.

When I compile it to JS (Pub Build) and run it as JS under Google Chrome, my polymer (big) component doesn't appear and I have this message in console :

"Resource interpreted as Script but transferred with MIME type application/dart: "127.0.0.1:8080/cvwebkit.html_bootstrap.dart". cvwebkit.html:295"

line 295 : <script type="application/dart" src="cvwebkit.html_bootstrap.dart"></script></body></html>

When I change this line to <script src="cvwebkit.html_bootstrap.dart.js"></script></body></html> in cvwebkit.html in the build directory, it works.

When I launch directly the modified file, I have this url and it works (at least partially) 127.0.0.1:3030/CVWebkit/WebApp/build/web/cvwebkit.html

When I launch normally the "dev" file as JS, I have the above issue with this url : 127.0.0.1:8080/cvwebkit.html

My "head" :

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CVWebKit</title>
<link rel="stylesheet" href="cvwebkit.css">
<link rel="import" href="packages/polymer/polymer.html">
<link rel="import" href="imgdyn.html"> <!--to ensure dynamic assets are created by polymer, so that there is no attempt first by the browser-->
<link rel="import" href="cvwebkitscript.html"> <!--needed to include the link to the dart script as we can't use both "src" and "export" in the script line-->
<link rel="import" href="zone-ruban.html">
<script type="application/dart">export 'package:polymer/init.dart';</script>
</head>

Any idea ?

KuroTenshi
  • 33
  • 6
  • 1
    Try changing your type to this. type="application/dart;component=1" in all your polymer elements. In your index / main, add this. Then build and compile – ptDave Jun 07 '14 at 18:00
  • The message can be ignored. But ptDave is right ;component=1 is required and also the import of polymer/polymer.html in the head section. – Robert Jun 08 '14 at 07:04
  • Thanks for the replies. But you can't do that anymore since Polymer 0.10-Pre.13. The latest version is currently Polymer 0.10.1 "final". My app worked with Polymer 0.10-Pre.12. I tried anyway your suggestion, but with no success (only warnings). I add my "head" at the end of my first post – KuroTenshi Jun 08 '14 at 19:59
  • 1
    ;component=1 is outdated since 0.10.0 – Günter Zöchbauer Jun 08 '14 at 21:02

0 Answers0