Not allowed to load local resource #46
-
Hello. I'm new to Electron. I would like to ask you how I could solve my problem. When launching the unpacked application via Exe, the home page (index.html ) is being loaded. But as soon as I try to switch to other html, an error appears in the console. (There is no error in the unconverted dev version of the project)
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Thanks for opening up a discussion! It's hard to tell what's going wrong without seeing your exact config and directory structure. I can give a guess on what's happening, if you haven't altered any configs: By default, everything in Normally, a Vue project only has 1 entry point / html file, hence your
I heavily recommend installing Vue Router, as you can super easily define routes there :) |
Beta Was this translation helpful? Give feedback.
Thanks for opening up a discussion!
It's hard to tell what's going wrong without seeing your exact config and directory structure. I can give a guess on what's happening, if you haven't altered any configs:
By default, everything in
<root>/src
is being ignored by Electron Builder, this is because we need to pack Electron with transpiled JavaScript files instead of TypeScript / Vue files. These transpiled (build) files can be found in<root>/build
after compilation. The reason why it works on dev is because Vite's dev server is able to serve the TypeScript files in<root>/src
directly as JavaScript.Normally, a Vue project only has 1 entry point / html file, hence your
login.html
is not be…