timarney / react-app-rewired

Override create-react-app webpack configs without ejecting
MIT License
9.79k stars 425 forks source link

npm start error: 'The "path" argument must be of type string or an instance of Buffer or URL. Received undefined' #544

Closed antonioOrtiz closed 2 years ago

antonioOrtiz commented 3 years ago
npm -v: 7.13.0
node -v: v14.16.0,

package.json:
{
  "name": "client-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@publicismedia-ds/ui-all": "^2.0.0",
    "@publicismedia-ds/ui-app-sdk": "^2.0.1",
    "@publicismedia-ds/ui-charts": "^2.0.0",
    "@publicismedia-ds/ui-checkbox": "^2.0.1",
    "@publicismedia-ds/ui-datatable": "^2.3.2",
    "@publicismedia-ds/ui-datepicker": "^2.0.1",
    "@publicismedia-ds/ui-drag-drop": "^2.0.2",
    "@publicismedia-ds/ui-dropdown": "^2.0.1",
    "@publicismedia-ds/ui-tabs": "^2.0.1",
    "@publicismedia-ds/ui-theme": "^2.0.4",
    "@reduxjs/toolkit": "^1.5.1",
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.3.2",
    "@testing-library/user-event": "^7.1.2",
    "axios": "^0.21.1",
    "env-cmd": "^10.1.0",
    "file-saver": "^2.0.5",
    "indicative": "^7.4.4",
    "lodash": "^4.17.21",
    "primeflex": "^2.0.0",
    "primeicons": "^4.1.0",
    "primereact": "^6.3.2",
    "react": "^16.14.0",
    "react-csv": "^2.0.3",
    "react-dom": "^16.13.1",
    "react-redux": "^7.2.4",
    "react-router-dom": "^5.2.0",
    "react-scripts": "4.0.0",
    "semantic-ui-css": "^2.4.1",
    "xlsx": "^0.16.9"
  },
  "scripts": {
    "antonio-start": "SSL_CRT_FILE=localhost.pem SSL_KEY_FILE=localhost-key.pem react-app-rewired start",
    "start": "react-app-rewired start",
    "build": "react-app-rewired build",
    "build:development": "env-cmd -f .env.development react-app-rewired build",
    "build:staging": "env-cmd -f .env.staging react-app-rewired build",
    "build:preproduction": "env-cmd -f .env.preproduction react-app-rewired build",
    "build:production": "env-cmd -f .env.production react-app-rewired build",
    "test": "react-app-rewired test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "react-app-rewired": "^2.1.8",
    "sass": "^1.32.13"
  }
}

Essentially I just either of those start commands and get: npm start error: 'The "path" argument must be of type string or an instance of Buffer or URL. Received undefined'

dawnmist commented 3 years ago

I've tried to create a new CRA project using your package.json file, but I get errors because @publicismedia/ui-all is not available in the yarn or npm package directories. I'm assuming that means that those are internal company packages, but it means that I am not able to debug anything with the information provided.

The last time I've seen messages like the ones you have reported, they were caused by a mismatch between the versions of jest & babel-jest being used in the project, but those were showing up in the test target rather than the start target. The best help I can give at this stage would be to suggest that you start putting console.log debug statements inside the commands being run by a build, so that you can narrow down at what point the build is failing, then to dive into the various libs that are being invoked at that point to identify where the error is actually being thrown. (Which is exactly what I would need do myself to try to debug it - if I could have installed from the project.json file provided).