tools: Failing to find behaviors after switching to 0.5.1

Description

After switching from 0.5.0 to 0.5.1 I have following errors:

init_1   | error:   In vendor/neon-animation/neon-animation-runner-behavior.html: [unknown-polymer-behavior] - Unable to resolve behavior `Polymer.NeonAnimatableBehavior`. Did you import it? Is it annotated with @polymerBehavior?
init_1   | error:   In vendor/neon-animation/animations/fade-in-animation.html: [unknown-polymer-behavior] - Unable to resolve behavior `Polymer.NeonAnimationBehavior`. Did you import it? Is it annotated with @polymerBehavior?
init_1   | error:   In vendor/neon-animation/animations/fade-out-animation.html: [unknown-polymer-behavior] - Unable to resolve behavior `Polymer.NeonAnimationBehavior`. Did you import it? Is it annotated with @polymerBehavior?
init_1   | error:   In vendor/iron-selector/iron-multi-selectable.html: [unknown-polymer-behavior] - Unable to resolve behavior `Polymer.IronSelectableBehavior`. Did you import it? Is it annotated with @polymerBehavior?
init_1   | error:   In vendor/neon-animation/animations/opaque-animation.html: [unknown-polymer-behavior] - Unable to resolve behavior `Polymer.NeonAnimationBehavior`. Did you import it? Is it annotated with @polymerBehavior?
init_1   | error:   In vendor/paper-menu-button/paper-menu-button-animations.html: [unknown-polymer-behavior] - Unable to resolve behavior `Polymer.NeonAnimationBehavior`. Did you import it? Is it annotated with @polymerBehavior?
init_1   | error:   In vendor/paper-menu-button/paper-menu-button-animations.html: [unknown-polymer-behavior] - Unable to resolve behavior `Polymer.NeonAnimationBehavior`. Did you import it? Is it annotated with @polymerBehavior?
init_1   | error:   In vendor/paper-menu-button/paper-menu-button-animations.html: [unknown-polymer-behavior] - Unable to resolve behavior `Polymer.NeonAnimationBehavior`. Did you import it? Is it annotated with @polymerBehavior?
init_1   | error:   In vendor/paper-menu-button/paper-menu-button-animations.html: [unknown-polymer-behavior] - Unable to resolve behavior `Polymer.NeonAnimationBehavior`. Did you import it? Is it annotated with @polymerBehavior?
init_1   | error:   In vendor/paper-input/paper-input.html: [unknown-polymer-behavior] - Unable to resolve behavior `Polymer.IronFormElementBehavior`. Did you import it? Is it annotated with @polymerBehavior?
init_1   | error:   In vendor/paper-input/paper-input.html: [unknown-polymer-behavior] - Unable to resolve behavior `Polymer.PaperInputBehavior`. Did you import it? Is it annotated with @polymerBehavior?
init_1   | error:   In vendor/iron-lazy-pages/iron-lazy-pages.html: [unknown-polymer-behavior] - Unable to resolve behavior `Polymer.IronLazyPagesBehavior`. Did you import it? Is it annotated with @polymerBehavior?
init_1   | error:   In vendor/paper-dialog/paper-dialog.html: [unknown-polymer-behavior] - Unable to resolve behavior `Polymer.PaperDialogBehavior`. Did you import it? Is it annotated with @polymerBehavior?
init_1   | error:   In vendor/paper-input/paper-input-error.html: [unknown-polymer-behavior] - Unable to resolve behavior `Polymer.PaperInputAddonBehavior`. Did you import it? Is it annotated with @polymerBehavior?

Project structure:

src/
  index.html
vendor/             # bower_components
bower.json

polymer.json:

{
    "entrypoint": "src/index.html",
    "shell": "src/components/app/bi-app/bi-app.html",
    "fragments": [
        "src/components/pages/bi-404/bi-404-page.html", # etc
        ...
    ],
    "sources": [
        "src/**/*"
    ]
}

Versions & Environment

  • polymer-build: 0.5.1
  • node: 6.9.1
  • Operating System: Mac OS El Capitan 10.11.5

Please pay attention that vendor (bower components dir) is outside of src. Not sure if this is the reason. In local env, I mount both directories into docker container as volumes, and I have a symlink src/vendor which points to vendor.

Adding bower.json to sources doesn’t help.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 29 (20 by maintainers)

Most upvoted comments

@nicholaswmin there used to be a bug in analyzer which treated not related comments, e. g eslint instructions, like behaviors annotations. It was fixed in 2.2.0 by assuming that no newline should present there.

@tsvetan-ganev

You also need to include the behaviour name in the annotation:

<script>
    /**
     * @polymerBehavior MyCustomBehavior
     */
    Polymer.MyCustomBehavior = {};
</script>

Also for some strange reason including newlines between the annotation and the definition throws lint warnings [unknown-polymer-behavior]. I’m guessing it’s a bit more strict than it should?

@abdonrd yes! This was fixed on master with the analyze-first work. It’s available today via the next tag (npm install poylmer-build@next --save-dev), and we hope to get it pushed out broadly in the next few days.

/cc @web-padawan as well