I had started working w/React a month ago. Downloaded a bunch of libraries some of which were useful. But when I tried to get date-io/date-fns to work I got stuck. I was getting strange errors of not being able to find 'Button in @material-ui', so I went to look in my folder structure and found THREE COPIES of package.json in my project!! I had been installing packages into the default folder when you open a command window in vscode. Don't know who they ended up all over the place.
Anway, I decided to start a new project from scratch in vscode and copy all my source folders over, then reinstall all the packages I was using. Here's what I did:
created a new vscode .net core project/react js (no redux)
copied my source folder from my old project folder to the new one. replacing all files/folders in the new project.
opened up a powershell cmd window. Entered the following commands:
yarn upgrade react yarn add react-router yarn add-react-router-dom yarn add formik yarn add yup yarn add @material-io/core yarn add @material-io/icons yarn add @material-io/pickers yarn add @date-io yarn add @date-io/date-fns yarn add yup
Okay, so then I compiled the app and ran it. I STILL get a date-fn error, but a different one now:
Module not found: Can't resolve 'date-fns/_lib/format/longFormatters' in 'C:\projects\DoxaProject\DoxaUI\DoxaUI\node_modules@date-io\date-fns\build'
My package.json file has the latest dependencies, INCLUDING date-io/date-fns.
Why am I getting this error? I've now spend a day trying to just get ONE date field working. If anyone can help I'd truly appreciate it!