Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing process.env.PWD on Windows OS - [ERR_INVALID_ARG_TYPE] #13

Open
dejanjankovic opened this issue Mar 14, 2022 · 2 comments
Open

Comments

@dejanjankovic
Copy link

This is a Bug Report

Description

  • What went wrong?
  • Creating test CLI application and the build crashed.
  • What did you expect should have happened?
  • Compile a working build.
  • What was the config (if any) you used?
  • It was a standard CLI template config.
  • What stacktrace or error message did you see?
  • [ERR_INVALID_ARG_TYPE] The issue is related to the missing env.PWD. I think you should check if the PWD is undefined. I am not sure if the setting of PWD to be process.cwd() will work for all, but it should work for most. It is not related to the powershell as it bugs the same with CMD

Similar or dependent issues:

Additional Data

  • Which version of node and npm are you using?: 17.5.0 and 8.5.4
  • Operating System: Windows 10 64
  • Stack Trace:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
   at new NodeError (node:internal/errors:371:5)
   at validateString (node:internal/validators:120:11)
   at Object.join (node:path:429:7)
   at KopytkorcReader._getAbsolutePath (C:\Framework\test-framework\node_modules\@dazn\kopytko-packager\src\env\kopytkorc-reader.js:149:17)
   at KopytkorcReader._getKopytkorcConfig (C:\Framework\test-framework\node_modules\@dazn\kopytko-packager\src\env\kopytkorc-reader.js:110:32)
   at new KopytkorcReader (C:\Framework\test-framework\node_modules\@dazn\kopytko-packager\src\env\kopytkorc-reader.js:16:28)
   at Object.<anonymous> (C:\Framework\test-framework\node_modules\@dazn\kopytko-packager\src\env\kopytko-config.js:6:19)
   at Module._compile (node:internal/modules/cjs/loader:1097:14)
   at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)
   at Module.load (node:internal/modules/cjs/loader:975:32)
   at Function.Module._load (node:internal/modules/cjs/loader:822:12)
   at Module.require (node:internal/modules/cjs/loader:999:19)
   at require (node:internal/modules/cjs/helpers:102:18)
   at Object.<anonymous> (C:\Framework\test-framework\node_modules\@dazn\kopytko-packager\src\core\plugins.js:3:44)
   at Module._compile (node:internal/modules/cjs/loader:1097:14)
   at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10) {
 code: 'ERR_INVALID_ARG_TYPE'
}
  • Provider Error messages:
@tbazelczuk
Copy link
Collaborator

Hi dejanjankovic,

Thank you for your feedback. We are currently investigating this issue.

@wakoliVotes
Copy link

Hi, anyone found the solution to the above, having the same issue as below while using React JS

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:371:5)
    at validateString (node:internal/validators:120:11)
    at Object.join (node:path:429:7)
    at noopServiceWorkerMiddleware (D:\frontend\node_modules\react-dev-utils\noopServiceWorkerMiddleware.js:14:26)
    at Layer.handle [as handle_request] (D:\frontend\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (D:\frontend\node_modules\express\lib\router\index.js:317:13)
    at D:\frontend\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (D:\frontend\node_modules\express\lib\router\index.js:335:12)
    at next (D:\frontend\node_modules\express\lib\router\index.js:275:10)
    at launchEditorMiddleware (D:\frontend\node_modules\react-dev-utils\errorOverlayMiddleware.js:20:7)
    at Layer.handle [as handle_request] (D:\frontend\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (D:\frontend\node_modules\express\lib\router\index.js:317:13)
    at D:\frontend\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (D:\frontend\node_modules\express\lib\router\index.js:335:12)
    at next (D:\frontend\node_modules\express\lib\router\index.js:275:10)
    at handleWebpackInternalMiddleware (D:\frontend\node_modules\react-dev-utils\evalSourceMapMiddleware.js:42:7)

In the console, it says Compiled successfully.

Compiled successfully!

You can now view frontend in the browser.        

  Local:            http://localhost:3000/       
  On Your Network:  http://19x.xxx.xxx.xx:3000/  

Note that the development build is not optimized.
To create a production build, use npm run build. 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants