Hi, following Stimulus 2 upgrade I’m getting the following error:
Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'Object.keys(valueDescriptorMap)')
when importing a controller from another package such as:
import FlashController from "stimulus-flash"
application.register("flash", FlashController)
If I load the same controller from app/javascript/controllers
it works fine.
The following method raises.
./node_modules/@stimulus/core/dist/application.js
function(step(op))
if (op[0] & 5) throw op[1];
I’m using Rails and webpack is compiling it all fine.
No idea where to check so far. Any recommendations?
var t=require("stimulus");module.exports=function(t){var e,n;function o(){return t.apply(this,arguments)||this}n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var i,r=o.prototype;return r.connect=function(){this.autohide&&this.setInterval()},r.initialize=function(){this.delay=this.delayConfig,this.autohide=this.autohideConfig},r.setInterval=function(){var t=this;setTimeout(function(){t.close()},this.delay)},r.close=function(){var t=this;this.stopInterval(),this.element.style.opacity="0",setTimeout(function(){t.element.remove()},300)},r.disconnect=function(){this.stopInterval()},r.stopInterval=function(){clearTimeout(this.setInterval)},(i=[{key:"delayConfig",get:function(){return parseInt(this.data.get("delay"))||2e3}},{key:"autohideConfig",get:function(){return"false"!=this.data.get("autohide")}}])&&function(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}(o.prototype,i),o}(t.Controller);