-
Notifications
You must be signed in to change notification settings - Fork 120
undefined is not a function #39
Comments
Do you have any code before importing webcomponents? You shouldn't be seeing this unless you're setting (Also can you add your browser, browser version and OS?) |
aww, I do. I am using angular ... hope this helps |
When you say, "I do" do you mean you have scripts before webcomponents.js? Or that you're setting WebComponents.flags.log? And are you working through this Polymer tutorial (in which case Angular should not be involved) or are you doing a different tutorial? |
Sorry for not being clearer. I have angular code after the webcomponents.js . I was using the tutorial for guidance on how to implement polymer (I wanted to use the ui from polymer in my angular app) Are the two incompatible ? |
Gotcha. I know people have used Angular and Polymer together. I don't have any experience with it myself. You might take a look over here as a starting point: https://gabiaxel.github.io/ng-polymer-elements/ (I haven't tested this, so YMMV, but might serve as a starting point for using Polymer with Angular.) |
I have the same problem (webcomponents.js line 30) but do not have any code before importing webcomponents.js. I am not explicitly setting WebComponents.flags.log. Running Win7 64-bit with chrome Version 40.0.2214.115 m. That said, my polymer components on page appear to be working fine. |
I got this because I was importing a non-existent (custom) polymer component. But my setup is pretty crazy (Meteor.js + differential:vulcanize + Polymer), so no idea whether that's your issue, too. |
Same problem here :( I am not using tutorials. I have installed The problem is that It seems that this is fixed at https://github.com/webcomponents/webcomponentsjs/blob/master/webcomponents.js#L37 but I can not see any version informations there. And I hope this is the correct repository ^^. webcomponents/webcomponentsjs@bc7afc1 Fix error calling .split on undefined. |
Looks like it's fixed but hasn't been released yet. @garlicnation is that On Sat, Mar 7, 2015 at 12:30 AM, Stephan Ahlf notifications@github.com
|
I got this error message to go away by pulling out the , , and tags as well as removing the <script> to include webcomponents.js from the polymer-element file for the custom tag i was creating. In the older example I was working from it seemed like a fully tagged html file was the way to go but in more recent examples i've only seen the polymer-element (with script and link tags) and no parent tags containing them. |
@AnothrNmbr looks like your comment lost some pieces, which tags were you pulling out? |
oops, so my custom polymer-element file was a fully tagged html file with html, head, and body tags as well as its own script tag to reference webcomponents.js. I thought I saw this pattern in some example somewhere, but after looking again at more recent examples, the files defining polymer-elements never had these top level containers. after removing them and the reference to webcomponents.js (which is still referred to in the parent document), the error message went away. |
the HTML Import you create for your polymer element should only need to reference polymer.html, it does not need to include webcomponents.js ex: <link rel="../components/polymer/polymer.html">
<polymer-element name="x-foo">
...
</polymer-element> |
ok got it. For some reason, this was no problem before I updated from 0.5.1 to 0.5.5. anyway, thanks for your help! |
It's fixed at head. You can temporarily update your dependency to head, or wait until the next release(later today, pending some Spartan testing). |
same error, i have integrated polymer with meteor this is my main.html <title>MyApp</title>
<link rel="shortcut icon" href="/resources/favicon.ico"/> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/components/webcomponentsjs/webcomponents.js"></script>
<link href='//fonts.googleapis.com/css?family=Roboto:400,700' rel='stylesheet' type='text/css'> the error: |
Also encountering this issue 👍 |
Hello @ALL, I resolved this issue to my wrong usage. First of all you indeed need webcomponents.js. I guess it shims functionality for other Browsers than chrome. While chrome supports some things native other Browsers need this library. To resolve this issue you need to link the library before any HTML import. Here is my working example https://github.com/s-a/beatproducer/blob/81e1d24df76da8ac77200254bd0a916b8cc5a09e/public/index.html#L9 |
…efore all the other stuff The polyfill should be included before anything Polymer-related, otherwise it will cause problems. It did cause a JS error: `undefined is not a function (webcomponents.js:30)`. This commit fixes that issue. More info: googlearchive/polymer-tutorial#39
thought I'd try the tutorials, but can't get past #1 :(
When I include webcomponents.js, I get this message
undefined is not a function (webcomponents.js:30)
line 30 is :
var parts = flags.log.split(",");
The text was updated successfully, but these errors were encountered: