0

I'm learning React and for a project having to clone AirBnB and wanting to be able to work off coding so I see changes live instead of starting/stopping the server over and over again. I know this is possible as I've done it before just not with React. I've done a lot of Googling and asked questions to my peers but still cannot find a solution. If anyone has any clarity that would be extremely helpful. Here's my current package.json for my frontend portion of my project.

{
  "name": "frontend",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^11.2.7",
    "@testing-library/user-event": "^12.8.3",
    "js-cookie": "^3.0.5",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-redux": "^7.2.9",
    "react-router-dom": "^5.3.4",
    "react-scripts": "5.0.1",
    "redux": "^4.2.1",
    "redux-thunk": "^2.4.2"
  },
  "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": {
    "redux-logger": "^3.0.6"
  },
  "proxy": "http://localhost:8000"
}

I have tried using different scripts, installing different dependencies, trying different extensions. To no avail, haven't had this fixed.

Jo Jo
  • 1
  • Is your app under /mnt/c somewhere, or under a WSL path like /home? There are issues with WSL and Windows drives (this is a Windows issue, not a Node/React Issue), see also [this discussion](https://stackoverflow.com/questions/69276057/wsl-2-react-not-reloading-with-file-changes) and [this thread](https://github.com/facebook/create-react-app/issues/10253) – Zac Anger May 06 '23 at 22:14
  • Yes it is under /mnt/c! Should I move it? – Jo Jo May 06 '23 at 23:28
  • That's one easy solution, yes. You could also try changing the start script in your package.json to `WATCHPACK_POLLING=true react-scripts start` – Zac Anger May 06 '23 at 23:44
  • Fixed! Thank you so much, sorry I just misunderstood my filing systems. – Jo Jo May 07 '23 at 06:14

0 Answers0