I switched from 0.17.0 to 0.18.0-alpha.9 because of some issues integrating with web-component-tester-istanbul. However I then tried to integrate with polymer-redux and everything was going fine, polymer test is working, polymer serve is working, but polymer build fails.
I rolled back to 0.17.0 and the build succeeds just fine
Create a PolymerRedux behavior
<link rel="import" href="../bower_components/polymer-redux/polymer-redux.html">
<link rel="import" href="./app.html">
<script>
/** @polymerBehavior */
ReduxBehavior = PolymerRedux(app.store);
</script>
Import and use the behavior in an app
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="./redux-behavior.html">
<dom-module id="my-app">
<template>
<div class="user">[[currentUser]]</div>
</template>
<script>
Polymer({
is: 'my-app',
behaviors: [ReduxBehavior],
properties: {
currentUser: {
type: String,
statePath: function(state) {
var currentUser = state.currentUser;
return currentUser === null ? 'null' : currentUser.displayName;
}
}
}
});
</script>
</dom-module>
Run polymer build
Build succeeds
Build fails with the following error on 0.18.0-alpha.9 but succeeds on 0.17.0
error: In src/my-app.html: [unknown-polymer-behavior] - Unable to resolve behavior `ReduxBehavior`. Did you import it? Is it annotated with @polymerBehavior?
error: Promise rejection: Error: 1 error(s) occurred during build.
error: Error: 1 error(s) occurred during build.
at BuildAnalyzer._done (/Users/pghalliday/projects/github/pghalliday-boilerplate/polymer-firebase-boilerplate/app/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:201:25)
at BuildAnalyzer.<anonymous> (/Users/pghalliday/projects/github/pghalliday-boilerplate/polymer-firebase-boilerplate/app/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:185:26)
at next (native)
at fulfilled (/Users/pghalliday/projects/github/pghalliday-boilerplate/polymer-firebase-boilerplate/app/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:17:58)
at process._tickCallback (internal/process/next_tick.js:103:7)
I can reproduce, it looks like we may only be registering behaviors correctly when they are an object literal. @rictic can you take a look?
I just upgraded to 0.18.0-pre.10 and I still get this
EDIT: I've found a workaround, instead of :
````javascript
/**
try:
````javascript
/**
Is there a way to disable analyze when running polymer build?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
I just upgraded to 0.18.0-pre.10 and I still get this
EDIT: I've found a workaround, instead of :
````javascript
/**
*
*/
const ReduxBehavior = PolymerRedux(store)
````
try:
````javascript
/**
*
*/
const ReduxBehavior = Object.assign({}, PolymerRedux(store))
````