1👍
Look for the network tab in the console, you’ll probably notice that your fetch call is returning a 404 html page. The server is most likely not serving the package.json but that depends on your setup. (you normally wouldn’t want to serve it anyway)
Are you running a default vue cli environment with an npm run serve
? If so you can add a json file in the assets dir, this should be served normally and it can be fetched at /assets/{insert the rest of the path here}.
EDIT
Say you have projects.json in the assets dir like you mentioned in the comments you should be able to access it with fetch("/assets/projects.json")
- [Vuejs]-In vue-electron, how to do you bind data between a parent and child components?
- [Vuejs]-Trying to follow a tutorial to build a spring boot vuejs project but get some errors
Source:stackexchange.com