1

When running npm run build on a project where I've changed something on its package.json, produces the exact same output as if I hadn't done any changes after running npm run build again.

I'm trying to upload the build folder to Pinata and it's producing the same hash (CID), so both folders (pre and post modification) are exactly the same.

What could be happening here?

This is my package.json file:

{
  "name": "react-template",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.16.4",
    "@testing-library/react": "^13.2.0",
    "@testing-library/user-event": "^13.5.0",
    "react": "^18.2.0",
    "react-copy-to-clipboard": "^5.1.0",
    "react-dom": "^18.1.0",
    "react-icons": "^4.6.0",
    "react-router-dom": "^6.3.0",
    "react-scripts": "5.0.1",
    "react-toastify": "^9.0.8",
    "sass": "^1.51.0",
    "uuid": "^9.0.0",
    "web-vitals": "^2.1.4",
    "web3": "^1.8.1",
    "tailwindcss": "^3.1.8"
  },
  "scripts": {
    "start": "PORT=3001 react-scripts start", 
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "homepage":"./"
}

Thanks!

dNyrM
  • 545
  • 1
  • 4
  • 17

1 Answers1

1

npm run build just runs react-scripts build.

If you updated your dependencies, you need to npm install or npm update them first.

OwnageIsMagic
  • 1,949
  • 1
  • 16
  • 31
  • `npm update` did the job – dNyrM Dec 14 '22 at 20:42
  • @dNyrM If you changed property not related to dependencies, maybe `react-scripts` doesn't consider checking `package.json` for build cache check. `npm update` resolved this time because it just updated minor version of some dependency, so cache was invalidated. I suggest you to file issue on this package directly. – OwnageIsMagic Dec 14 '22 at 20:48
  • Got it! I'll do that. Thanks a lot! – dNyrM Dec 14 '22 at 21:28