googlearchive / polymer-atom

BSD 3-Clause "New" or "Revised" License
14 stars 4 forks source link

TypeError: Cannot read property 'forEach' of undefined #6

Closed herkulano closed 7 years ago

herkulano commented 9 years ago

screen shot 2015-11-19 at 15 52 58

garlicnation commented 9 years ago

Can you provide me with a sample file that exhibits this behavior? There was an issue in hydrolysis a few releases ago that could be causing this.

herkulano commented 9 years ago
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html">
<link rel="import" href="../../bower_components/iron-list/iron-list.html">
<link rel="import" href="../../bower_components/iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="../../bower_components/paper-styles/paper-styles-classes.html">
<link rel="import" href="../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
<link rel="import" href="../../bower_components/paper-button/paper-button.html">
<link rel="import" href="../../bower_components/iron-icons/iron-icons.html">

<link rel="import" href="../../styles/shared-styles.html">

<dom-module id="app-dashboard">
  <template>
    <style include="shared-styles"></style>

    <iron-ajax
      id="request"
      url="http://...:3000/products"
      on-response="handleSearchAjax"
      auto></iron-ajax>

    <div class="flex vertical layout container">
      <div class="search horizontal layout">
        <paper-input id="searchInput" class="flex" tabindex="1" label="Search"
          on-input="handleSearch"
          floatingLabel>
        </paper-input>

        <paper-dropdown-menu id="searchFilter"
          tabindex="2" label="By">
          <paper-menu class="dropdown-content"
            selected="{{selectedFilter}}">
            <template is="dom-repeat" items="[[filters]]" as="filter">
               <paper-item value="[[filter.value]]">[[filter.label]]</paper-item>
             </template>
          </paper-menu>
        </paper-dropdown-menu>

        <paper-button id="searchBt"
          on-tap="handleSearch"
          class="flat"
          tabindex="3">SEARCH</paper-button>

        <template is="dom-if" if="{{!isSearchEmpty}}">
          <paper-button id="searchClearBt"
            on-tap="handleSearchClear"
            class="clear"
            tabindex="3">
            <iron-icon icon="clear"></iron-icon>
          </paper-button>
        </template>

      </div>

      <template is="dom-if" if="{{hasSearchItems}}">
        <iron-list id="list" class="flex" items="[[data]]" as="item">
          <template>
            <div on-tap="handleItemSelection">
              <div class="item" tabindex="0">
                <span class="note">[[item.product_id]]</span>
                <span class="primary">[[item.non_proprietary_name]]</span>
                <span class="strong">[[item.labeler_name]]</span>
                <span class="inline">[[item.dosage_form_name]]</span>,
                <span class="inline">[[item.route_name]]</span>
                <span class="small truncate">[[item.pharm_classes]]</span>
              </div>
            </div>
          </template>
        </iron-list>
      </template>

      <template is="dom-if" if="{{!hasSearchItems}}">
        <div class="no-results flex center horizontal layout center-justified">
          <div>
              We couldn't find anything.<br>
              Please try again...
          </div>
        </div>
      </template>

    </div>

    <div class="flex horizontal layout center center-justified container">
      <div>
        ...
      </div>
    </div>

  </template>

  <script src="./app-dashboard.js" charset="utf-8"></script>
</dom-module>
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../styles/shared-styles.html">

<dom-module id="app-settings">
  <template>
    <style include="shared-styles"></style>
    <style>
      :host {
        display: block;
      }
    </style>

    <div>Settings here...</div>

  </template>

  <script src="./app-settings.js" charset="utf-8"></script>
</dom-module>

Both throw this error.

garlicnation commented 9 years ago

What version of the plugin do you have?

herkulano commented 9 years ago

v0.0.8

It's no longer throwing an error, but it's also not linting.

In this case it's not linting the missing import and the missing property:

<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../styles/shared-styles.html">

<dom-module id="app-settings">
  <template>
    <style include="shared-styles"></style>
    <style>
      :host { display: block; }
    </style>
    <div>Hello from <span>[[missingProperty]]</span></div>
    <paper-button raised>Missing Import</paper-button>
  </template>
  <script src="./app-settings.js" charset="utf-8"></script>
</dom-module>
class AppSettings {
  beforeRegister() {
    this.is = 'app-settings';
    this.properties = { };
  }
  created() {}
  ready() {}
  attached() {}
  detached() {}
  attributeChanged() {}
}

Polymer(AppSettings);