I am following the tutorial https://github.com/vasansr/pro-mern-stack-2 (to build a CRUD app 'Issue Tracker'). Since i split the app from a single server to separate api and ui servers, I have been having problems getting the ui to load in the browser. Initially i was getting 'unexpected token < in JSON at position 0' in the dev tools console (after creating separate ui and api servers). Then failing to fix this i continued with the chapter hoping more changes might resolve the issue. Now i have completed everything up to and including Ch7 Proxy-Based-Architecture. The ui will still not load in the browser and i'm getting the above (404) error. Everything else appears to be working fine: both servers are running in the terminal and the graphql playground is loading fine.
The code should be fine as i've even gone over it and even copied and pasted from this Git repository just to be double sure. I've also checked the file structure. The only difference is my package.json, as due to dependancy issues i've encountered, some of the package versions are different, so i'm wondering if this could be the problem. But it is unclear to me as i'm getting no issues in the terminal when i run the servers.
This is my ui package.json:
{
"name": "pro-mern-stack-2-ui",
"version": "1.0.0",
"description": "Pro MERN Stack (2nd Edition) - UI",
"main": "index.js",
"scripts": {
"start": "nodemon -w uiserver.js -w .env uiserver.js",
"compile": "babel src --out-dir public",
"watch": "babel src --out-dir public --watch --verbose"
},
"repository": {
"type": "git",
"url": "git+https://github.com/vasansr/pro-mern-stack-2.git"
},
"author": "[email protected]",
"license": "ISC",
"homepage": "https://github.com/vasansr/pro-mern-stack-2",
"dependencies": {
"dotenv": "^6.2.0",
"express": "^4.16.4",
"http-proxy-middleware": "^0.21.0",
"nodemon": "^1.18.9"
},
"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.2.3",
"@babel/preset-react": "^7.0.0"
}
}