hotwired / stimulus

A modest JavaScript framework for the HTML you already have
https://stimulus.hotwired.dev/
MIT License
12.55k stars 420 forks source link

Capybara + Poltergeist Can't find variable: Set #154

Closed blahutka closed 6 years ago

blahutka commented 6 years ago

Hi, does anybody has the same issue with poltergeist throwing error Can't find variable: Set It's in the stimulus code when it tries to call new Set().

My setup is webpacker with Stimulus. In development it runs without problem. Does anybody knows how to fix this ? Thank you

twalpole commented 6 years ago

Poltergeist/PhantomJS supports ES5, but Set was added to JS in ES6/2015. In order to have Set available you'd need a polyfill. You're probably better off just switching over to using Selenium with headless chrome for testing if you're using Stimulus

javan commented 6 years ago

See https://stimulusjs.org/handbook/installing#browser-support for a list of polyfills you may need to support older browser.