Closed 171h closed 1 year ago
pnpm dlx nuxi@latest init electron-nuxt pnpm add -D nuxt-electron vite-electron-plugin vite-plugin-electron-renderer electron electron-builder
export default defineNuxtConfig({ modules: [ 'nuxt-electron', ], electron: { include: ['electron'], outDir: 'dist-electron', }, })
import { app, BrowserWindow } from 'electron' app.whenReady().then(() => { new BrowserWindow().loadURL(process.env.VITE_DEV_SERVER_URL) })
{ + "main": "dist-electron/main.js" }
you can see this reproduction repo https://github.com/171h/test2-electron-nuxt.git
[Window Title] Error [Main Instruction] Error launching app [Content] Unable to find Electron app at D:\Python\Project\learnElectron\electron-nuxt Cannot find module 'D:\Python\Project\learnElectron\electron-nuxt' Require stack: - D:\Python\Project\learnElectron\electron-nuxt\node_modules\.pnpm\electron@24.1.3\node_modules\electron\dist\resources\default_app.asar\main.js - [确定]
Maybe the 👉 examples/quick-start is better for you :)
Thanks
I init a project with the bellow step:
install nuxt and this module
Add nuxt-electron to the modules section of nuxt.config.ts
Create the electron/main.ts file and type the following code
Add the main entry to package.json
you can see this reproduction repo https://github.com/171h/test2-electron-nuxt.git
Report bellow error: