mikeal / vuejs-electron-demo

Simple Vue.js Electron demo
59 stars 22 forks source link

Electron can't find static files after building the Vue app #4

Open weiying-chen opened 4 years ago

weiying-chen commented 4 years ago

First of all, thanks for this demo. I was also fed up with the complexity of existing demos.

Your demo worked perfectly. But when you do electron app.js after building the Vue project, you see this:

Failed to load resource: net::ERR_FILE_NOT_FOUND
app.af13196c.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
chunk-vendors.9804a263.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND

I think there's something wrong with url =file://${process.cwd()}/dist/index.html

These are my dependencies:

  "dependencies": {
    "core-js": "^3.6.4",
    "electron": "^8.0.2",
    "vue": "^2.6.11"
  }

What could be the problem and how to fix it?

Note: I'm using Ubuntu 16.04 and Vue CLI 4.

ImSeaWorld commented 4 years ago

This seems to be the case with all demos I've looked at. Static files don't work at all. Were you able to find a solution @alexcheninfo?