Closed yotoman455 closed 6 months ago
Hello @yotoman455 ,
I have the same problem as you.
Did you find the solution?
Hi Yoann,
Yes found a solution. webpack-encore and symfony/asset-mapper can't work together. You must use webpack-encore or symfony/asset-mapper
I chose webpack-encore
composer remove symfony/asset-mapper
composer require encore --dev
// assets/bootstrap.js
import { startStimulusApp } from '@symfony/stimulus-bridge';
// Registers Stimulus controllers from controllers.json and in the controllers/ directory
export const app = startStimulusApp(require.context(
'@symfony/stimulus-bridge/lazy-controller-loader!./controllers',
true,
/\.[jt]sx?$/
));
import './bootstrap.js'
npm install
npm run build
npm run dev
And it worked for me fine without any errors
Thanks for the solution.
For my part I succeeded by adding in the "package.json" file but this is not optimal
Hello,
Anybody can help me? I'm just learning Symfony and I'm facing a problem, which is difficult for me to find out what exactly is wrong.
I have installed via terminal:
Error on Terminal:
Module build failed: Module not found: "./assets/bootstrap.js" contains a reference to the file "@symfony/stimulus-bundle". This file can not be found, please check it for typos or update it if the file got moved.
Error on Browser
assets/bootstrap.js
importmap.php
package.json
composer.json
anybody knows what am I doing wrong?
would appriciate if anybody could help me solve it