Getting this error thrown with a controller, seems to be linked to accessing a target, but unconfirmed.

Stripped back my controller to the following code... Console.log('1') fires, the rest is where the error is thrown.
Data-controller is on the body, as it needs to be a site-wide thing.
// Samples Controller
import { Controller } from 'stimulus'
export default class extends Controller {
static targets = ['counter']
connect() {
this.updateCount()
}
updateCount() {
console.log('1')
console.log(this.counterTargets)
console.log('2')
}
}
It seems to stem from this...
Scope.prototype.findAllElements = function (selector) {
var head = this.element.matches(selector) ? [this.element] : [];
var tail = this.filterElements(Array.from(this.element.querySelectorAll(selector)));
return head.concat(tail);
};
Edit: this.targets.findAll('counter') returns the same error in all controllers.
Stimulus supports all evergreen, self-updating desktop and mobile browsers out of the box.
If your application needs to support older browsers like Internet Explorer 11, include the聽
@stimulus/polyfills聽package before loading Stimulus.
Are you using that 馃憜?
Doh!!! My bad! Deepest apologies!
I get this issue again, because the @stimulus/polyfills version matcher for element-closest is pulling in 3.0.0, which doesn't work the same / is broken: https://github.com/jonathantneal/closest/issues/25 & https://github.com/jonathantneal/closest/blob/master/CHANGELOG.md
Fixed in v1.1.1 via https://github.com/stimulusjs/stimulus/commit/0251c87795f351a7462d00fa0f028b2daf967a01. Thanks for the heads up, @jalada!
this is incompatible with the latest webpacker which depends on core-js 3 :(
@glaszig did you find a solution?
@chrisokamoto this occured to me while upgrading to the latest webpacker at the time on a rails 5.2 code base. i reverted that upgrade and things work fine.
@chrisokamoto this occured to me while upgrading to the latest webpacker at the time on a rails 5.2 code base. i reverted that upgrade and things work fine.
@glaszig yeah, the same for me. but I don't want to downgrade Rails and Webpacker.. I'll try something else, which include stop using stimulus.. :( it's just a small component in my case.
Thanks for the reply :)
Most helpful comment
Fixed in v1.1.1 via https://github.com/stimulusjs/stimulus/commit/0251c87795f351a7462d00fa0f028b2daf967a01. Thanks for the heads up, @jalada!