{"action":"opened","issue":{"url":"https://api.github.com/repos/Polymer/tools/issues/1494","repository_url":"https://api.github.com/repos/Polymer/tools","labels_url":"https://api.github.com/repos/Polymer/tools/issues/1494/labels{/name}","comments_url":"https://api.github.com/repos/Polymer/tools/issues/1494/comments","events_url":"https://api.github.com/repos/Polymer/tools/issues/1494/events","html_url":"https://github.com/Polymer/tools/issues/1494","id":395616485,"node_id":"MDU6SXNzdWUzOTU2MTY0ODU=","number":1494,"title":"behaviors in elements using separate .js file (Unable to resolve behavior)","user":{"login":"elf-pavlik","id":876431,"node_id":"MDQ6VXNlcjg3NjQzMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/876431?v=4","gravatar_id":"","url":"https://api.github.com/users/elf-pavlik","html_url":"https://github.com/elf-pavlik","followers_url":"https://api.github.com/users/elf-pavlik/followers","following_url":"https://api.github.com/users/elf-pavlik/following{/other_user}","gists_url":"https://api.github.com/users/elf-pavlik/gists{/gist_id}","starred_url":"https://api.github.com/users/elf-pavlik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elf-pavlik/subscriptions","organizations_url":"https://api.github.com/users/elf-pavlik/orgs","repos_url":"https://api.github.com/users/elf-pavlik/repos","events_url":"https://api.github.com/users/elf-pavlik/events{/privacy}","received_events_url":"https://api.github.com/users/elf-pavlik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2019-01-03T15:35:06Z","updated_at":"2019-01-03T15:35:06Z","closed_at":null,"author_association":"NONE","body":"When I use behaviors in separate .js file, I get\r\n> Unable to resolve behavior `Polymer.AppLocalizeBehavior`. Did you import it? Is it annotated with @polymerBehavior?at line 5 col 26\r\n\r\nExample based on component generated with `polymer-cli`\r\n\r\n`foo.js`\r\n```js\r\n/* global Polymer */\r\nPolymer({\r\n\r\n  is: 'foo-element',\r\n  behaviors: [ Polymer.AppLocalizeBehavior ],\r\n\r\n  properties: {\r\n    prop1: {\r\n      type: String,\r\n      value: 'foo-element'\r\n    }\r\n  }\r\n\r\n})\r\n```\r\n`foo-element.html`\r\n```html\r\n<link rel=\"import\" href=\"../polymer/polymer.html\">\r\n<link rel=\"import\" href=\"../app-localize-behavior/app-localize-behavior.html\">\r\n\r\n<!--\r\n`foo-element`\r\n\r\n\r\n@demo demo/index.html\r\n-->\r\n\r\n<dom-module id=\"foo-element\">\r\n  <template>\r\n    <style>\r\n      :host {\r\n        display: block;\r\n      }\r\n    </style>\r\n    <h2>Hello [[prop1]]</h2>\r\n  </template>\r\n\r\n  <script src=\"foo.js\"></script>\r\n</dom-module>\r\n\r\n```\r\n\r\nAt the same time it doesn't show any error when I use behaviors in `<script>` tag instead of separate .js file no matter if i import that behavior or not\r\n\r\n```html\r\n<link rel=\"import\" href=\"../polymer/polymer.html\">\r\n<!-- <link rel=\"import\" href=\"../app-localize-behavior/app-localize-behavior.html\"> -->\r\n\r\n<!--\r\n`foo-element`\r\n\r\n\r\n@demo demo/index.html\r\n-->\r\n\r\n<dom-module id=\"foo-element\">\r\n  <template>\r\n    <style>\r\n      :host {\r\n        display: block;\r\n      }\r\n    </style>\r\n    <h2>Hello [[prop1]]</h2>\r\n  </template>\r\n\r\n  <script>\r\n    Polymer({\r\n\r\n      is: 'foo-element',\r\n      behaviors: [ Polymer.AppLocalizeBehavior ],\r\n\r\n      properties: {\r\n        prop1: {\r\n          type: String,\r\n          value: 'foo-element',\r\n        },\r\n      },\r\n\r\n    });\r\n  </script>\r\n</dom-module>\r\n```\r\n\r\nThat behavior seems to have proper `@polymerBehavior` annotation\r\nhttps://github.com/PolymerElements/app-localize-behavior/blob/master/app-localize-behavior.html#L86"}}
{"actor":{"display_login":"elf-pavlik"}}