0

Trying to get @symfony/ux-react to work as per this documentation:

https://symfony.com/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?

1
  • What is the --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. Commented Mar 31 at 14:44

1 Answer 1

0

Ok the issue was the path, that is the correct one: './../react/controllers'

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.