0

I can easily run Next.js in VErcel, but somehow not vanilla React, why?

Got this:

Failed to compile.
16:18:04.101    
16:18:04.101    Module not found: Error: Can't resolve 'util' in '/vercel/path0/node_modules/uuidv4/build/lib'

Expand 10 Lines
16:18:04.137    error Command failed with exit code 1.
16:18:04.137    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
16:18:04.159    Error: Command "yarn run build" exited with 1
16:18:04.553    BUILD_UTILS_SPAWN_1: Command "yarn run build" exited with 1

Have this package.json:

{
  "name": "rentmebike",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@material-ui/core": "^4.12.4",
    "@material-ui/icons": "^4.11.3",
    "@material-ui/lab": "4.0.0-alpha.61",
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^14.0.0",
    "@testing-library/user-event": "^14.4.3",
    "@types/axios": "^0.14.0",
    "@types/moment": "^2.13.0",
    "@types/query-string": "^6.3.0",
    "@types/react-facebook-login": "^4.1.5",
    "@types/react-router-dom": "^5.3.3",
    "@types/react-signature-canvas": "^1.0.2",
    "@types/uuidv4": "^5.0.0",
    "axios": "^1.4.0",
    "moment": "^2.29.4",
    "prettier": "^2.8.8",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-facebook-login": "^4.1.1",
    "react-router": "^6.12.1",
    "react-router-dom": "^6.12.1",
    "react-scripts": "^5.0.1",
    "react-signature-canvas": "^1.0.6",
    "uuid": "^9.0.0",
    "uuidv4": "^6.2.13"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts 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": {
    "@types/jest": "^29.5.2",
    "@types/node": "^20.3.0",
    "@types/react": "^18.2.11",
    "@types/react-dom": "^18.2.4",
    "typescript": "^5.1.3"
  }
}
János
  • 32,867
  • 38
  • 193
  • 353

0 Answers0