creativetimofficial / argon-dashboard-react

React version of Argon Dashboard
MIT License
443 stars 751 forks source link

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined #34

Closed Rizzeol closed 4 years ago

Rizzeol commented 4 years ago

Version

1.1.0

Reproduction Link

Go to the link below: https://github.com/creativetimofficial/argon-dashboard-react

Opearting System

Windows 10

Device

Dell

Browser & Version

Firefox Browser 75.0 (64-bit)

Steps to reproduce

  1. git clone git@github.com:creativetimofficial/argon-dashboard-react.git

  2. cd argon-dashboard-react

  3. npm install

  4. npm start

It is compiled and served successfully but I see the error in my browser.

What is expected?

The app is served in http://localhost:3000/ and I can see the Argon dashboard as shown in demo website: Here

What is actually happening?

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined at validateString (internal/validators.js:112:11) at Object.join (path.js:375:7) at noopServiceWorkerMiddleware (C:\Users\RohitPaudel\Desktop\Projects\argon-dashboard-react\node_modules\react-dev-utils\noopServiceWorkerMiddleware.js:14:26) at Layer.handle [as handle_request] (C:\Users\RohitPaudel\Desktop\Projects\argon-dashboard-react\node_modules\express\lib\router\layer.js:95:5) at trim_prefix (C:\Users\RohitPaudel\Desktop\Projects\argon-dashboard-react\node_modules\express\lib\router\index.js:317:13) at C:\Users\RohitPaudel\Desktop\Projects\argon-dashboard-react\node_modules\express\lib\router\index.js:284:7 at Function.process_params (C:\Users\RohitPaudel\Desktop\Projects\argon-dashboard-react\node_modules\express\lib\router\index.js:335:12) at next (C:\Users\RohitPaudel\Desktop\Projects\argon-dashboard-react\node_modules\express\lib\router\index.js:275:10) at launchEditorMiddleware (C:\Users\RohitPaudel\Desktop\Projects\argon-dashboard-react\node_modules\react-dev-utils\errorOverlayMiddleware.js:20:7) at Layer.handle [as handle_request]

(C:\Users\RohitPaudel\Desktop\Projects\argon-dashboard-react\node_modules\express\lib\router\layer.js:95:5)

Conclusion

I also tried in MacOS and I got the same error. I think it is something very simple but I couldn't figure it out now. I wanted to buy a pro version today but skeptical if I will get the same error. I will really appreciate a quick response.

I used this template about 3 months ago and it was functioning for me. I like it so much but very unfortunate.

Thank you, great people.

einazare commented 4 years ago

Hello there, @Rizzeol ,

What version of NodeJS do you use? If you do not have the LTS version, please update it to the LTS version. If the issue persists, then change the react-scripts from our package.json file to the latest one from npmjs.

Best, Manu

Rizzeol commented 4 years ago

Hi @EINazare my nodejs version is 12.13.1

It seems like nodejs 12.x have Active LTS starting from 2019.10.21

New update: Issue Solved

updated react-scripts package from v2.8.1 to v3.4.1

If you face same issue follow this:

  1. Go to NPM react-script package website and copy npm i react-scripts
  2. Remove react-scripts v2.8.1 from your package.json file and run npm i react-scripts in your terminal. This will install latest react-scripts package. It is v3.4.1 for me now.
  3. I received the following error. If it's working for you that's great. If you are getting same error, follow the next step:

./src/assets/scss/argon-dashboard-react.scss (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-5-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--6-oneOf-5-3!./node_modules/sass-loader/dist/cjs.js??ref--6-oneOf-5-4!./src/assets/scss/argon-dashboard-react.scss) Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (72) For more information on which environments are supported please see: https://github.com/sass/node-sass/releases/tag/v4.11.0

  1. Go to your terminal and run this command. npm uninstall node-sass && npm install node-sass

The above error means your node version is not compatible with node-sass installed in your project so you have to update it or install it again.

This must solve the issue. At least it worked for me.

Thanks @EINazare for your response. Appreciate it. Cheers.