Reputation: 77
I'm trying to create a custom element, I had several warnings in my result page that I've fixed. The last one is:
custom element with name "paper-fab-menu" not found. See http://goo.gl/5HPeuP#polymer_11 for details.
I checked the element's code, removed all scripts to make things simple, here's the code
<link rel="import" href="../../../packages/polymer/polymer.html">
<link rel="import" href="../../../packages/paper_elements/paper_fab.html">
<polymer_element name="paper-fab-menu" noscript>
<template>
<paper-fab icon='menu'></paper-fab>
</template>
<!--<script type="application/dart" src="paper_fab_menu.dart"></script>-->
</polymer_element>
There's no warnings about this code.
There's no warning in my index.html code when I import my element (there was one about the incorrect path, but it was solved), here's the import part of my index.html:
<link rel="import" href="packages/core_elements/core_scaffold.html">
<link rel="import" href="packages/core_elements/core_item.html">
<link rel="import" href="packages/core_elements/core_icon.html">
<link rel="import" href="packages/core_elements/core_submenu.html">
<link rel="import" href="packages/paper_elements/paper_input.html">
<link rel="import" href="../lib/custom_paper_elements/paper_fab_menu.html">
<!--<script async type="application/dart" src="index.dart"></script>-->
<script type="application/dart">export 'package:polymer/init.dart';</script>
<script async src="packages/browser/dart.js"></script>
The dart editor is still marking the <paper-fab-menu>
as a warning. Polymer's error states that this error points an incorrect import, but all the imports are solved correctly, I can't see the problem!
Windows 8.1 Dart Editor 1.8.5 Dart SDK 1.8.5
Thanks for your help
Upvotes: 1
Views: 234
Reputation: 657058
The <polymer_element ...
should be <polymer-element ...
(dash instead of underline)
You should not go outside the top-level directories using ../
. Only import from lib
or from within the current top-level directory.
To import from lib
use <link rel="import" href="packages/yourpackagename/custom_paper_elements/paper_fab_menu.html">
For more details see: https://www.dartlang.org/polymer/app-directories.html This looks a bit complicated but usually you get good warnings with hints how the import path should look like.
Upvotes: 1