I am doing polymer dart. Everything works fine with dart vm but when I try to deploy it, it fails (compilation was okay.) When I run the built js version. It gave me the error
Uncaught TypeError: Cannot call method 'shL' of null
I tried to trace the compiled js code, and it seems like due to query an element that is not yet in the document (it is in the html file but somehow only the head of the document is loaded at that time.) Since it's the compiled version, it's really hard to trace which part went wrong. Also, there's no error in dart vm and dart2js.
Does anyone know why this is happening or I did something wrong?
PS. I think to make dart more popular, at least dart2js compiler has to be as stable as whenever the code runs fine on vm is fine in the js version. Having developer try to debug on the compiled js code is really annoying. Thanks, Yi
==UPDATE==
Here is the html file (before being built)
<html>
<head>
<meta charset="utf-8">
<title>Sample app</title>
<link rel="stylesheet" href="myHtml.css">
<link rel="import" href="template/my-element.html">
<script type="application/dart">export 'main.dart';</script>
<script src="packages/browser/dart.js"></script>
</head>
<body>
<my-element id="myElement" class="myElement" numOfRow="3"></my-element>
</body>
</html>