I have the Nx workspace with React and Express apps created via the official React tutorial from Nx docs. Also, I have an independent CRA project that has just one commit after using npx create-react-app
command. I want to add my CRA project to Nx workspace preserving git histories. How can I do that?
I had read docs pages about preserving git histories and manual migration and then tried to migrate the project this way:
npx cra-to-nx
command as the docs said.The migration was successful but then I tried to serve or build migrated CRA app and got this error:
Where did I go wrong? Maybe I deleted some important configuration when was solving the conflicts?
This issue isn't really connected with migration from CRA to Nx. The problem was in the BUILD_PATH env that was in the yarn build
script. I don't know why the BUILD_PATH isn't working this way, but when I write it in the .local.env
file and not in the script, everything is fine.
The weird symbols rendered instead of the error message was the error message in russian. They are rendered correctly if I launch the yarn build
script from the CRA project, not from the Nx workspace.
The migration approach that I tried to use should work, but you really don't need it. The approach from the Doing the migration manually section of CRA-to-Nx docs' page is fast and easy.