diff --git a/src/index.ts b/src/index.ts index 8c640ce..ee6660e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -104,10 +104,9 @@ export default defineNuxtModule({ listen(server, listener) { // For `viteConfig.promise` can able resolved (async function _listen() { - const addressInfo = server.address() as AddressInfo Object.assign(process.env, { // This is required, and it is used in Electron-Main. - VITE_DEV_SERVER_URL: `http://localhost:${addressInfo.port}`, + VITE_DEV_SERVER_URL: `http://localhost:${listener.address.port}`, }) // https://github.com/electron-vite/vite-plugin-electron/blob/v0.11.2/src/index.ts#L37-L59