stimulus-bridge icon indicating copy to clipboard operation
stimulus-bridge copied to clipboard

Your controllers.json file was not found. Be sure to add a Webpack alias from "@symfony/stimulus-bridge/controllers.json" to *your* controllers.json file.

Open dokselblackbit opened this issue 2 years ago • 3 comments

Hello. I have some error: Your controllers.json file was not found. Be sure to add a Webpack alias from "@symfony/stimulus-bridge/controllers.json" to *your* controllers.json file. I added into webpack.config.js Encore.enableStimulusBridge('./assets/controllers.json') How to fix it?

controllers.json is into assets { "controllers": [], "entrypoints": [] }

dokselblackbit avatar Dec 13 '22 10:12 dokselblackbit

Hi!

Hmm, I'm not sure! Encore.enableStimulusBridge('./assets/controllers.json') should be all you need. That creates a Webpack alias from @symfony/stimulus-bridge/controllers.json to ./assets/controllers.json, which this bridge then uses. I can't imagine what would be causing this to short-circuit. Is there anything special of custom about your set up or Webpack setup?

weaverryan avatar Dec 13 '22 16:12 weaverryan

I do not know if this is still an issue, but https://github.com/symfony/stimulus-bridge/issues/30#issuecomment-776326465 solved it for me. I overwrote the alias and using Encore.addAliases({}) fixed it for me.

amavis442 avatar Apr 11 '23 15:04 amavis442

add this - .enableStimulusBridge('./assets/controllers.json') - in webpack.config.js

Oussama-lasri avatar May 03 '24 13:05 Oussama-lasri