我正在使用Nuxt 3与Electron JS,但为什么构建应用程序会导致启动时出现白色屏幕?

kupeojn6  于 6个月前  发布在  Electron
关注(0)|答案(1)|浏览(154)

大家好
我正在尝试从我的ElectronJS/Nuxt 3应用程序中构建一个版本。我只看到一个白色屏幕。我已经尝试了SO周围提到的hashmode选项,但它仍然不起作用。我做错了什么,它仍然不起作用?我在下面粘贴我的代码,看看是否有人可以帮助引导我在正确的方向。我已经分析了文件,问题是在vue-router,特别是它如何将资源文件的路径设置为file:///而不是绝对路径。
下面是我的nuxt.config.ts:

export default defineNuxtConfig({
  ssr: false,
  router: {
    options: {
      hashMode: true
    }
  },
  app: {
    baseURL: './',
  },
  modules: ['nuxt-primevue', 'nuxt-electron'],
  css: ['~/assets/theme.css', '~/assets/styles.css'],
  electron: {
    build: [
      {
        // Main-Process entry file of the Electron App.
        entry: 'electron/main.ts',
      },
      {
        entry: 'electron/preload.ts',
        onstart(options) {
          // Notify the Renderer-Process to reload the page when the Preload-Scripts build is complete, 
          // instead of restarting the entire Electron App.
          options.reload()
        },
      },
    ],
    renderer: {},
  }
})

字符串
我很感激你的帮助。谢谢。

sq1bmfud

sq1bmfud1#

如果您使用的是Nuxt 3.8,请尝试降级到Nuxt 3.7。

相关问题