-
-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Labels
bugSomething isn't workingSomething isn't working
Description
When using electron-forge + Vite + asarmor I can see the following error logged to the devtools console:
Uncaught SyntaxError: Invalid or unexpected token
The app still works fine though, this is a visual annoyance at best and a minor performance degradation at worst.
This happens because the browser still tries to load any encrypted assets defined in the output .vite/rendere/main_window/index.html:
<!-- ... -->
<script type="module" crossorigin src="./assets/index.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index.css">Because this file is loaded here, right before decrypting the render process:
| mainWindow.loadFile(path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/index.html`)); |
Removing the render script from the root index.html:
<!-- ... -->
<script type="module" src="/src/renderer.ts"></script>`... doesn't resolve the issue because then Vite no longer picks it up for processing and we end up with a different error.
Thus, we should figure out a way to tell Vite to include these source files but not output them to .vite/rendere/main_window/index.html.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working