-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot GET / #27
Comments
私も同じ問題を抱えています。 しかし、その本番用のURLが分かりません。 I have the same problem. However, I do not know the URL for production. electron-template/template/main.js: const _NUXT_URL_ = `http://localhost:${server.address().port}`
・・・
if (config.dev) {
・・・
} else { return win.loadURL(_NUXT_URL_) } |
did you guys ever resolve this? @uucyan @terion-name cc: @pi0 |
Mine seems to build w/o any issue after running |
@tetreault nope :( |
@tetreault Because there is no choice, it was solved by the following method. |
首先,非常感谢您的分享,但是,在使用过程种遇到了很多问题,如下: |
For developers who are looking for a alternative solution: |
const newWin = () => {
win = new BrowserWindow({
icon: path.join(__dirname, 'static/icon.png'),
webPreferences: {
nodeIntegration: true
},
width: 1920,
height: 1080
})
win.on('closed', () => win = null)
// Wait for nuxt to build
const pollServer = () => {
http.get(_NUXT_URL_, (res) => {
if (res.statusCode === 200) {
win.loadURL(_NUXT_URL_)
} else {
setTimeout(pollServer, 300)
}
}).on('error', pollServer)
}
if (config.dev) {
// Install vue dev tool and open chrome dev tools
const {
default: installExtension,
VUEJS_DEVTOOLS
} = require('electron-devtools-installer')
installExtension(VUEJS_DEVTOOLS.id).then(name => {
console.log(`Added Extension: ${name}`)
win.webContents.openDevTools()
}).catch(err => console.log('An error occurred: ', err))
pollServer()
} else {
pollServer()
}
} this will work with production env |
Hey there ! Not working for me too. Any solution ? @Atinux 🙏 |
Sadly I don’t have time to debug on Electron :( |
I am also facing same issue, it will be great if this can be fixed.🙏 @Atinux |
Version
v1.1.1
Reproduction link
https://github.com/terion-name/metod-admin-temp
Steps to reproduce
What is expected ?
app works
What is actually happening?
Cannot GET /
Additional comments?
I've used this template, generated app. In dev mode everything works ok. But If I build the app I get this:
![Скриншот 2018-10-05 11.53.58.png](https://camo.githubusercontent.com/dc4a932c5257a103f1a5beb11e380d6f97cb3e9549662f498cc5b5913c0c14d0/68747470733a2f2f636d74792e73332e65752d776573742d312e616d617a6f6e6177732e636f6d2f38323535353430312f35656262373164302d633837642d313165382d616138662d3437323235623333306637362e706e67)
package.json:
The text was updated successfully, but these errors were encountered: