caoxiemeihao / nuxt-electron

Integrate Nuxt and Electron
MIT License
169 stars 18 forks source link

Nuxt Devtools 1.0.6 problem with nuxt-electron 0.6.0 & 0.7.0 #63

Open RichySano opened 6 months ago

RichySano commented 6 months ago

Hi @caoxiemeihao,

I don't know if I'm doing the right thing by opening an issue here or on @nuxt/devtools repository but I have a problem.

If I use @nuxt/devtools@1.0.2 with nuxt-electron@0.6.0 I have no problem.

image

If I use @nuxt/devtools@1.0.6 with nuxt-electron@0.6.0, I have this problem.

image

I've added

nitro: { runtimeConfig: { app: { baseURL: './', } }
},

in nuxt.config.ts file.

And if i use @nuxt/devtools@1.0.6 with nuxt-electron@0.7.0, I have this problem.

image

listSerialPorts is in preload.ts file of folder electron.

and i've commented

nitro: { runtimeConfig: { app: { baseURL: './', } }
},

if not, I have the same problem as with version nuxt-electron@0.6.0.

The problem seems to start from version 1.0.3 of @nuxt/devtools.

Another thing, do you know why I get this error if I use import { SerialPort } from 'serialport' instead of const { SerialPort } = require('serialport') ?

image

Here the link for test repository.

https://github.com/RichySano/nuxt-electron-app.git

Thank you in advance for your assistance and for your project. Excellent work

caoxiemeihao commented 2 months ago

Hey! 👋 You can try the following changes. I explain it here 👉 https://github.com/caoxiemeihao/nuxt-electron/issues/74

package.json

{
  "scripts": {
-   "dev": "nuxt dev"
+   "dev": "nuxt dev--no-fork"
  }
}