Can't install Stimulus Reflex
Hi,
I'm trying to install Stimulus Reflex but get an error when I run bin/dev afterwards. I followed the doc but can't make it work.
I suspect that it has to do with Jumpstart using Esbuild instead of Webpackers but am not sure how to solve it. Any idea?
I'm trying to install Stimulus Reflex but get an error when I run bin/dev afterwards. I followed the doc but can't make it work.
I suspect that it has to do with Jumpstart using Esbuild instead of Webpackers but am not sure how to solve it. Any idea?
bhouy@Benjamins-iMac french_together % bin/dev 15:30:44 web.1 | started with pid 5255 15:30:44 css.1 | started with pid 5256 15:30:44 js.1 | started with pid 5257 15:30:44 guard.1 | started with pid 5258 15:30:44 worker.1 | started with pid 5259 15:30:44 css.1 | yarn run v1.22.17 15:30:44 js.1 | yarn run v1.22.17 15:30:44 css.1 | $ tailwindcss --postcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --watch 15:30:44 js.1 | $ node esbuild.config.js --watch 15:30:45 js.1 | > ../../node_modules/stimulus_reflex/javascript/stimulus_reflex.js:451:49: error: Cannot assign to "reflexRoot" because it is a constant 15:30:45 js.1 | 451 │ ...eflexRoot.length === 0 && element.id) reflexRoot = `#${element.id}` 15:30:45 js.1 | ╵ ~~~~~~~~~~ 15:30:45 js.1 | ../../node_modules/stimulus_reflex/javascript/stimulus_reflex.js:447:10: note: "reflexRoot" was declared a constant here 15:30:45 js.1 | 447 │ const reflexRoot = element.getAttribute( 15:30:45 js.1 | ╵ ~~~~~~~~~~ 15:30:45 js.1 | 15:30:45 js.1 | > ../../node_modules/stimulus_reflex/javascript/stimulus_reflex.js:1:27: error: Could not resolve "stimulus" (mark it as external to exclude it from the bundle) 15:30:45 js.1 | 1 │ import { Controller } from 'stimulus' 15:30:45 js.1 | ╵ ~~~~~~~~~~ 15:30:45 js.1 | 15:30:45 js.1 | > controllers/application_controller.js:1:27: error: Could not resolve "stimulus" (mark it as external to exclude it from the bundle) 15:30:45 js.1 | 1 │ import { Controller } from 'stimulus' 15:30:45 js.1 | ╵ ~~~~~~~~~~ 15:30:45 js.1 | 15:30:45 js.1 | error Command failed with exit code 1. 15:30:45 js.1 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 15:30:45 js.1 | exited with code 1 15:30:45 system | sending SIGTERM to all processes 15:30:45 worker.1 | terminated by SIGTERM 15:30:45 guard.1 | terminated by SIGTERM 15:30:46 css.1 | exited with code 1 15:30:46 web.1 | terminated by SIGTERM
This article has a working demo.
Upgrading the StimulusReflex gem and npm package to 3.5.0.pre8 should do the trick.
Upgrading the StimulusReflex gem and npm package to 3.5.0.pre8 should do the trick.
Notifications
You’re not receiving notifications from this thread.