Trying to get @symfony/ux-react to work as per this documentation:
.html
Did the following steps
composer require symfony/ux-react
yarn add -D @babel/preset-react --force
yarn encore dev --watch
Also added the react.yaml
file to config/packages
All seems to work fine but fails here:
import { registerReactControllerComponents } from '@symfony/ux-react';
registerReactControllerComponents(require.context('./react/controllers', true, /\.(j|t)sx?$/));
The error message is
"./assets/js/app.ts" contains a reference to the file "./react/controllers". This file can not be found, please check it for typos or update it if the file got moved.
Tried to use relative path but no success either.
What am I missing?
Trying to get @symfony/ux-react to work as per this documentation:
https://symfony/bundles/ux-react/current/index.html
Did the following steps
composer require symfony/ux-react
yarn add -D @babel/preset-react --force
yarn encore dev --watch
Also added the react.yaml
file to config/packages
All seems to work fine but fails here:
import { registerReactControllerComponents } from '@symfony/ux-react';
registerReactControllerComponents(require.context('./react/controllers', true, /\.(j|t)sx?$/));
The error message is
"./assets/js/app.ts" contains a reference to the file "./react/controllers". This file can not be found, please check it for typos or update it if the file got moved.
Tried to use relative path but no success either.
What am I missing?
Share Improve this question edited Mar 31 at 14:42 hakre 198k55 gold badges449 silver badges855 bronze badges Recognized by PHP Collective asked Mar 31 at 14:34 nerdessnerdess 11k11 gold badges50 silver badges66 bronze badges 1 |1 Answer
Reset to default 0Ok the issue was the path, that is the correct one: './../react/controllers'
--force
being used for? And please run the composer diagnose function and put the command as well as the result into your question by editing it. – hakre Commented Mar 31 at 14:44