waliente / phaser-typescript-electron

A starter template that uses Phaser 3, TypeScript, Electron and Rollup and Vite for bundling.
MIT License
33 stars 6 forks source link

Build failes wiith failed to load URL / Connection refused #1

Closed carstenheisterkamp closed 1 year ago

carstenheisterkamp commented 1 year ago

The final build does not work, that app starts but the html is not loaded.

"build" and "preview" script end with "(node:5402) electron: Failed to load URL: http://localhost:3000/ with error: ERR_CONNECTION_REFUSED" error.

"dev" works as expected.

Dan-Mizu commented 1 year ago

you need to set your NODE_ENV environment variable to "production".

main.js under the electron directory is what checks it when building and uses either localhost or the actual file path of the build.