We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
- Operating System: Windows_NT - Node Version: v20.12.2 - Nuxt Version: 3.11.2 - CLI Version: 3.11.1 - Nitro Version: 2.9.6 - Package Manager: npm@10.5.0 - Builder: - - User Config: app, modules, ssr, router, build, vite - Runtime Modules: @nuxtjs/eslint-module@4.1.0, @pinia/nuxt@0.5.1, () - Build Modules: -
can't share code due to corporate law if very necessary I will try to create an electron-fiddle
In my electron app I am using Nuxt and have been migrating from v2 to v3 over the last few days.
Now when calling my builder function in main.js I get the error
TypeError: Cannot read properties of undefined (reading 'map') at initNuxt (nuxt/dist/index.mjs:3928:46)
for this
async function readyNuxt() { const { createNuxt } = await import('nuxt') nuxt = createNuxt(configDev) nuxt.hook('build:done', () => { const application = express() application.use(nuxt.render) }) nuxt.ready() }
and
TypeError: Cannot read properties of undefined (reading 'flatMap') at resolveApp (nuxt/dist/index.mjs:4781:28)
async function readyNuxt() { const { createNuxt, build } = await import('nuxt') nuxt = createNuxt(configDev) nuxt.hook('build:done', () => { const application = express() application.use(nuxt.render) }) build(nuxt) }
In Nuxt 2 this worked perfectly:
async function readyNuxt() { const { Nuxt, Builder } = await import('nuxt') nuxt = new Nuxt(configDev) const builder = new Builder(nuxt) builder.build() nuxt.hook('build:done', () => { const application = express() application.use(nuxt.render) }) }
I know that there are libraries like nuxt-electron that take over a lot of the work here but would prefer keeping my own implementation for now.
nuxt-electron
Config used:
// Copyright (c) 2020-2024 Continental AG. import { defineNuxtConfig } from 'nuxt/config' import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify' export default defineNuxtConfig({ app: { baseURL: process.env.NODE_ENV === 'development' ? '/' : './', head: { meta: [ { charset: 'utf-8' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' }, { hid: 'description', name: 'description', content: process.env.npm_package_description || '', }, ], link: [{ rel: 'icon', type: 'image/x-icon', href: 'static/favicon.ico' }], }, }, modules: [ '@nuxtjs/eslint-module', '@pinia/nuxt', (_options, nuxt) => { nuxt.hooks.hook('vite:extendConfig', (config) => { // @ts-expect-error config.plugins.push(vuetify({ autoImport: true })) }) }, ], ssr: false, router: { hashMode: true, }, build: { extend(config, { isDev, isClient }) { if (isDev) config.mode = 'development' else { config.mode = 'production' } }, transpile: ['vuetify'], }, vite: { vue: { template: { transformAssetUrls, }, }, css: { preprocessorOptions: { scss: { additionalData: ` @use "./assets/scss/abstracts/_index.scss" as *; @use "./assets/scss/main.scss" as *; `, }, }, }, }, })
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Environment
Reproduction
can't share code due to corporate law
if very necessary I will try to create an electron-fiddle
Describe the bug
In my electron app I am using Nuxt and have been migrating from v2 to v3 over the last few days.
Now when calling my builder function in main.js I get the error
for this
and
for this
In Nuxt 2 this worked perfectly:
I know that there are libraries like
nuxt-electron
that take over a lot of the work here but would prefer keeping my own implementation for now.Additional context
Config used:
Logs
No response
The text was updated successfully, but these errors were encountered: