nuxt / vite

⚡ Vite Experience with Nuxt 2

Home Page:https://vite.nuxtjs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ReferenceError: Cannot access 'module' before initialization

Qonflux opened this issue · comments

Versions

nuxt-vite: 0.3.5
nuxt: 2.15.3

Reproduction

package.json:
"dependencies": {
"@nuxtjs/auth-next": "5.0.0-1618898588.9655d0e",
"@nuxtjs/axios": "^5.13.1",
"@nuxtjs/markdownit": "^2.0.0",
"@nuxtjs/sentry": "^5.1.7",
"core-js": "^3.9.1",
"fabric-history": "^1.6.0",
"fabric-with-gestures": "^4.5.0",
"fontfaceobserver": "^2.1.0",
"lru-cache": "^6.0.0",
"markdown-it-attrs": "^2.4.1",
"markdown-it-block-embed": "0.0.3",
"markdown-it-collapsible": "^1.0.0",
"markdown-it-div": "^1.1.0",
"markdown-it-link-attributes": "^4.0.0",
"markdown-it-video": "^0.6.3",
"mitt": "^3.0.0",
"nuxt": "^2.15.3",
"nuxt-i18n": "^6.26.0",
"nuxt-interpolation": "^0.2.3",
"portal-vue": "^2.1.7",
"reclameland-shared": "^1.0.170",
"v-click-outside": "^3.1.2",
"v-tooltip": "^2.1.3",
"vue-color": "^2.8.1",
"vue-frag": "^1.3.1",
"vue-multiselect": "^2.1.6",
"vue-toastification": "^1.7.14",
"vuex-persistedstate": "^4.1.0"
},
"devDependencies": {
"@nuxtjs/eslint-config": "^6.0.0",
"@nuxtjs/eslint-module": "^3.0.2",
"@nuxtjs/google-fonts": "^1.3.0",
"@nuxtjs/tailwindcss": "^4.2.1",
"autoprefixer": "^9.8.6",
"babel-eslint": "^10.1.0",
"eslint": "^7.22.0",
"eslint-plugin-nuxt": "^2.0.0",
"eslint-plugin-vue": "^7.7.0",
"nuxt-vite": "^0.3.5",
"postcss": "^7.0.39"
}

nuxt.config.js:
plugins: [
{ src: '/plugins/mitt.js', mode: 'client' },
{ src: '
/plugins/persisted-state.js', mode: 'client' },
{ src: '/plugins/vue-tooltip.js', mode: 'client' },
'
/plugins/vue-fragment.js',
'/plugins/currency.js',
'
/plugins/axios.js'
],

buildModules: [
'nuxt-vite',
'@nuxtjs/eslint-module',
'@nuxtjs/tailwindcss',
'@nuxtjs/google-fonts',
'reclameland-shared/nuxt'
],

modules: [
'@nuxtjs/axios',
'@nuxtjs/auth-next',
'@nuxtjs/markdownit',
'nuxt-i18n',
'nuxt-interpolation',
'portal-vue/nuxt',
'vue-toastification/nuxt'
],

i18n: {
baseUrl: process.env.BASE_URL,
defaultLocale: 'nl',
strategy: 'no_prefix',
locales: [
{
code: 'nl',
iso: 'nl-NL'
},
{
code: 'be',
iso: 'nl-BE'
}
],
vueI18n: {
fallbackLocale: 'nl',
messages: {
nl: {
...require('./node_modules/reclameland-shared/locales/rcl/nl-NL.json'),
...require('./node_modules/reclameland-shared/locales/main.json')
},
be: {
...require('./node_modules/reclameland-shared/locales/rcl/nl-BE.json'),
...require('./node_modules/reclameland-shared/locales/main.json')
}
}
}
},

Description

After building, I'm getting an error "ReferenceError Cannot access 'module' before initialization". This only happens when I use nuxt-vite, not when using webpack. What could be the cause?

Screenshot 2022-07-28 at 13 47 22