Not working with Nuxt3
See original GitHub issueI am trying to use this plugin with nuxt 3 but canβt make it work so far. I have the following nuxt.config.ts
import { rmSync } from "fs";
import electron from "vite-electron-plugin";
import renderer from "vite-plugin-electron-renderer";
rmSync("dist-electron", { recursive: true, force: true });
// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
ssr: false,
vite: {
plugins: [
electron({
include: ["electron"],
}),
// Use Node.js API in the Renderer-process
renderer({
nodeIntegration: true,
}),
],
},
});
and my folder structure is as advised:
.
βββ README.md
βββ app.vue
βββ dist
βββ electron
β βββ electron-env.d.ts
β βββ main.ts
β βββ preload.ts
βββ nuxt.config.ts
βββ package.json
βββ public
β βββ favicon.ico
βββ tsconfig.json
βββ yarn.lock
I am getting the following error:
ERROR Cannot start nuxt: Cannot read property 'on' of null 04:25:23
at configureServer (node_modules/vite-electron-plugin/index.mjs:332:25)
at Module.createServer (node_modules/vite/dist/node/chunks/dep-4da11a5e.js:62251:30)
at async buildClient (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.8e427c63.mjs:297:24)
at async bundle (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.8e427c63.mjs:853:3)
at async build (node_modules/nuxt/dist/index.mjs:2084:5)
at async Promise.all (index 1)
at async load (node_modules/nuxi/dist/chunks/dev.mjs:6785:9)
at async Object.invoke (node_modules/nuxi/dist/chunks/dev.mjs:6828:5)
at async _main (node_modules/nuxi/dist/cli.mjs:50:20)
The on refers to the httpServer
at this line of code here
Not sure how to solve this issue
Issue Analytics
- State:
- Created a year ago
- Comments:13
Top Results From Across the Web
not work with nuxt 3 Β· Issue #536 Β· nuxt-community/axios-module
I tryed to add this setting to my nuxt config. This solved this problem but a new error occurred on the client side....
Read more >Nuxt 3 tsconfig path is not working from parent directory
Nuxt advises against overriding the path in tsconfig.json in the root of the project.
Read more >Nuxt 3 Tailwind Not Working - YouTube
Nuxt 3 Tailwind Starter Kit. Download FREE now β https://www.nuxt.tips/tailwind-starterIn this tutorial, we discuss what to do if theΒ ...
Read more >Nuxt 3 + Tailwind + Eslint + i18n + Sentry Starter - Localazy
This short tutorial will help you set up a scalable Nuxt 3 ... Sentry helps you identify those problems quickly and gives you...
Read more >Nuxt 3 first steps. - ITNEXT
One thing that you can do with that is to disable HMR, which is not so efficient, but as for now it's the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi here! π
I have provided a temporary solution based on
vite-plugin-electron@0.10.3
. I plan to add betternuxt
support in the near future.nuxt.config.ts
vite-plugin-electron vs vite-electron-plugin
electron .
command to start or restart the Electron App.vite-plugin-electron
uses Vite builds such as Main-Process, Preload-Scripts, which are based on the build API provided by Vite, which means it works well with all of Viteβs ecosystems.vite-electron-plugin
is much faster(Not Bundle), it is only based onesbuild
to convert.ts
files, so its performance is very high. It has a plugin system that references Viteβs implementation, but is not compatible with Viteβs plugins.