Ant Design Cannot find module 'rc-textarea' - reactjs

I just created an Umi Ant Design Pro project but when i run my project (yarn start),i am getting the following error:
Steps taken to resolve this issue:
1:installed rc-textarea:
yarn add rc-textarea
2:stopped my server and ran yarn again in my terminal
3:then ran yarn start to start my server and still got the same error although my terminal this time stopped displaying the error i keep getting in my browser as seen below:
Step4:I then did some Research and came across this link
Git Memory Blog
But the path : ./node_modules/antd/es/input/TextArea.js does not exist in my project.
I also found a github link with a similar issue:
GithubIssue
Other solutions did not work so i tried wbcs's solution:
yarn cache clean
yarn install
But the error is still eminent.
My inspection window indicates that this is a possible webpack issue:
How do i resolve this?

Try removing .umi and node_modules folders, and then start this project again.

Related

How to Yarn add a specific branch/workspace

I forked react-select to add a couple of features that the current react-select doesn't have. I created a branch and committed it to my forked project. Now, i want to use the forked project.
Ive tried installing the forked react-select repo the following ways with out success.
yarn add #react-select/monorepo#<GithubUsername>/react-select#head=<Name of branch>&workspace=react-select
yarn add #react-select/monorepo#<GithubUsername>/react-select#commit=<commit#>&workspace=react-select
yarn add #react-select/<github url>#head=<Name of branch>&workspace=react-select
I've tried it with ssh, with git+. with everything that the yarn website says and all i get is react-select installed but i don't see the code changes thats in my branch.
I've also tried to install the react-select package that the monorepo uses, but i get the following error
yarn add react-select#https://github.com/<USERNAME>/react-select/tree/master/packages/react-select
Failed with errors in 0s 290ms
(node:11491) UnhandledPromiseRejectionWarning: Error: react-
select#https://github.com/USERNAME/react-
select/tree/master/packages/react-select isn't supported by
any available resolver
i am using yarn 2.4.2
Has anyone dealt with this?
Any solution besides just copying the folder and installing it from a file path?
I had the same issue but upgrading to yarn version 2 worked. The following syntax for adding workspaces only starts working from yarn 2 on:
yarn add #react-select/monorepo#<GithubUsername>/react-select#head=<Name of branch>&workspace=react-select

React: Module parse failed

I finished setting up node v13.14.0 on my windows 7 laptop then did "npm react-create-app name". After done downloading I was greeted with this error...
Image of my error
I tried searching it on stackoverflow there was a solution about webpack.config.js but I couldn't find it on my folder section.
vscode-folder-structure
Any idea, should reinstall ?
I got around this by creating a new user in windows (I found the solution on github comments somewhere ), then logged in as that user and installed "npx create-react-app app-name" and it worked somehow ¯_(ツ)_/¯.
enter image description here
If you are installing then use npm i create-react-app. If you are trying to creating react app then use npx create-react-app appname. If you have another issue then please elaborate on that issues.

Yarn start fails with Unexpected identifier without details

I am trying to start up a react app. After cloning the code from github, running yarn install I ran yarn start and got the following error:
yarn run v1.22.10
$ cross-env HTTPS=true react-scripts start
Unexpected identifier
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The authors of the app don't know what might be wrong (it's working for them). I tried creating another app with create react app and that started up fine for me. I am not sure where to start looking as there is no indication as to where the "unexpected identifier" might be located or what it might be. Any ideas on what I might want to check or try? I am on MacOS Catalina.
I figured it out eventually. I tried running build and it failed on syntax error in one of the .js files (a missing comma). Once that was fixed the start ran too. If the start command returned the same informative error the build did it would have saved me hours :)

Yarn build failed with Ant Design

I was going to redeploy a web app, so I was trying to run yarn build, and it runs into this error.
I am using Ant Design, I also did a yarn eject before, after a search through google still no luck, any encountered this is an error before? Any tips on solving it? thanks!
yarn run v1.22.0
$ react-app-rewired build
Creating an optimized production build...
Failed to compile.
./node_modules/antd/es/style/index.less
TypeError: this[MODULE_TYPE] is not a function
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Even I faced the same issue. My problem was I mixed up with Ant Design versions. Ant v4.x was released recently, so I used components without checking the version. So, try using components of same version and see if it works!!.
Okay, so for anyone who might face the same issue, you need to remove react-rewire and do the migration from V3 to V4 shown on Ant.Design Doc, then should be fine

Error on running a project after installing a package

I was running my project finely, but I merge my code with other which contain a package called react-modal, after that my code doesn't work. I revert that code from my project, but it doesn't work, I can't even run my project. "cannot read properties of undefined" error is occuring. I upgrade all my packages like webpack, webpack cli etc, but it doesn't helps. What I need to do to run my project?
Well you can do two things here.
First to revert your code back to your latest code before merge.
Run the below command to delete Node_modules npm prune --production
and then run npm install and then build your project.

Resources