TheDOK
TheDOK

Reputation: 19

how to resolve error with symfony ux component compiling

When i install UX Component like ux-chartjs per example i have this error when i compile with webpack encore ans component don't work :

ERROR Failed to compile with 1 errors 15:01:04

error in ./assets/controllers.json 15:01:04

Module build failed (from ./node_modules/@symfony/stimulus-bridge/dist/webpack/loader.js): Error: The file "@symfony/ux-dropzone/package.json" could not be found. Try running "yarn install --force". at createControllersModule (C:\laragon\www\DevQuizz\node_modules@symfony\stimulus-bridge\dist\webpack\loader.js:46:19) at Object.loader (C:\laragon\www\DevQuizz\node_modules@symfony\stimulus-bridge\dist\webpack\loader.js:106:43)

Yarn install --force => not resolve problem

Upvotes: 1

Views: 890

Answers (1)

Mif_00
Mif_00

Reputation: 1

I had a similar issue, it seems like like you switched from AssetMapper to Webpack Encore without deleting first one.

You have to have such line in your package.josn

"@symfony/ux-turbo": "file:vendor/symfony/ux-turbo/assets",

If you don't have it in package.josn, try delete AssetMapper and Webpack Encore and install only Webpack Encore again as it said in documentation https://symfony.com/doc/current/frontend.html#switch-from-assetmapper

composer remove symfony/ux-turbo symfony/asset-mapper symfony/stimulus-bundle

composer require symfony/webpack-encore-bundle symfony/ux-turbo symfony/stimulus-bundle

npm install
npm run dev

Notice! Remove might affect your config and your project, commit changes before do that

Upvotes: 0

Related Questions