Router not working with two BrowserWindows
See original GitHub issueHi, I’m trying to create an app with two BrowserWindows using the same Vue App with vue-router, but the router aren’t working. I’m always receiving error ‘Cannot GET /’ for the second route.
main\index.js
var mainURL = `http://localhost:9080/`
var secondURL = `http://localhost:9080/page2`
function createWindow () {
mainWindow = new BrowserWindow({
height: 600,
width: 800
})
mainWindow.loadURL(mainURL)
mainWindow.on('closed', () => {
mainWindow = null
})
secondWindow = new BrowserWindow({
height: 600,
width: 800
})
secondWindow.loadURL(secondURL)
secondWindow.on('closed', () => {
secondWindow = null
})
}
app.on('ready', createWindow)
routes.js
export default [
{
path: '/',
name: 'landing-page',
component: require('components/LandingPageView')
},
{
path: '/page2',
name: 'landing-page2',
component: require('components/LandingPageView2')
},
{
path: '*',
redirect: '/'
}
]
Testing code: https://github.com/melquic/vue-two-windows.git
Error print screen:
Thank you for help! Best.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
CANNOT ACCESS ROUTER ON MULTIPLE BROWSERS
Hello, I got a new computer (W10) and I cannot access my router on Chrome or Edge (routerlogin.net). A few months ago I...
Read more >Fix Internet Connected But Not Working Windows 10 - YouTube
Having network problems ? No Internet Access? Can't connect to the internet via a browser ? Computer says your connected to Internet but...
Read more >Internet Connection Sharing Not Working on Windows 10 ...
Internet Connection Sharing Not Working on Windows 10 [Tutorial]Many users reported receiving the error message Internet connection sharing ...
Read more >How To Fix WiFi Connected But No Internet Access ... - YouTube
Check if is a problem with the router 3. Run the Windows network troubleshooting tool 4. Reset your network adapter 5. Reset Windows...
Read more >How to Fix Some Websites Not Loading/Opening in ... - YouTube
In this video I will show guys how to fix some websites are not loading or opening in your Browser. DNS: 8.8.8.84.2.2.2CMD Command:ipconfig ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@melquic
I would highly avoid using the
history
mode as it won’t work in a final production app. By using the defaulthash
mode and changing the url in the second window tohttp://localhost:9080/#/page2
things should work fine.@SimulatedGREG Thank you a lot! It’s working now… By the way, how should I call the second route when I build production?
file://${__dirname}/index.html#page2
?