caoxiemeihao / nuxt-electron

Integrate Nuxt and Electron
MIT License
191 stars 21 forks source link

Error: Must provide a proper URL as target #84

Open stenuto opened 4 months ago

stenuto commented 4 months ago

Fresh nuxt 3 + nuxt-electron install. I ran into the endless loop issue so I'm using the "dev": "nuxi dev --no-fork" fix in my package.json successfully. I've got it working and everything is running seemingly fine, but I'm getting the following error in my terminal after running npm run dev:

 ERROR  [unhandledRejection] Must provide a proper URL as target                                                                                                10:04:28 PM

  at ProxyServer.ws (node_modules/httpxy/dist/index.mjs:521:9)
  at Object.upgrade (node_modules/nitropack/dist/chunks/server.mjs:374:24)
  at Server.<anonymous> (node_modules/nuxi/dist/chunks/dev2.mjs:6898:29)
  at Server.emit (node:events:532:35)
  at onParserExecuteCommon (node:_http_server:948:14)
  at onParserExecute (node:_http_server:849:3)

Any ideas how to satisfy this?

kingyue737 commented 3 months ago

disable opinionated config in this module and add app: { cdnURL: './' },:

export default defineNuxtConfig({
  app: { cdnURL: './' },
  electron: {
    disableDefaultOptions: true,
  }
}
mrswilson commented 3 months ago

Thank you! I had the same issue and this solved it.