amplitudes
amplitudes
NNuxt
Created by timmaier on 9/6/2024 in #❓・help
Nuxt build error (At least one <template> or <script> is required in a single file component)
Think I've found a workaround for now, setting "@vue-macros/nuxt": "1.11.6" in my package.json, deleting the lockfile, then reinstalling seems to stop it from erroring
19 replies
NNuxt
Created by timmaier on 9/6/2024 in #❓・help
Nuxt build error (At least one <template> or <script> is required in a single file component)
Honestly not really sure what's going on here, I've tried making a minimal reproduction which doesn't appear to have the same issue 🤔
19 replies
NNuxt
Created by timmaier on 9/6/2024 in #❓・help
Nuxt build error (At least one <template> or <script> is required in a single file component)
I have a feeling it could be vue-macros due to the nature of it modifying the compiler, though I haven't looked into it much as it's used heavily in my project, so removing it for testing would be quite a chore
19 replies
NNuxt
Created by timmaier on 9/6/2024 in #❓・help
Nuxt build error (At least one <template> or <script> is required in a single file component)
@timmaier perhaps it's a module? If you're able to provide a list of the ones you use, I could xref with mine to see if there's anything in common.
modules: [
'@nuxtjs/tailwindcss',
'@nuxt/image',
'@nuxt/fonts',
'@vue-macros/nuxt',
'@productdevbook/chatwoot',
'@nuxtjs/sitemap',
'@nuxtjs/leaflet',
'@cssninja/nuxt-toaster',
'@nuxtjs/i18n',
'@vue-final-modal/nuxt',
'@nuxt/content',
'@vee-validate/nuxt',
'@nuxtjs/robots',
'@nuxt/icon'
]
modules: [
'@nuxtjs/tailwindcss',
'@nuxt/image',
'@nuxt/fonts',
'@vue-macros/nuxt',
'@productdevbook/chatwoot',
'@nuxtjs/sitemap',
'@nuxtjs/leaflet',
'@cssninja/nuxt-toaster',
'@nuxtjs/i18n',
'@vue-final-modal/nuxt',
'@nuxt/content',
'@vee-validate/nuxt',
'@nuxtjs/robots',
'@nuxt/icon'
]
19 replies
NNuxt
Created by timmaier on 9/6/2024 in #❓・help
Nuxt build error (At least one <template> or <script> is required in a single file component)
When adding a console.log of the descriptor object into the Vue compiler where the error is thrown, you can see the defineAsyncComponent, which never gets resolved:
{
filename: 'Website/node_modules/.pnpm/@[email protected][email protected][email protected][email protected]_@[email protected]_@types+no_axu5chfqddbh5cdcaa6tz2fp3a/node_modules/@nuxt/content/dist/runtime/components/ContentDoc.vue',
source: 'import { defineAsyncComponent } from "vue"\n' +
'export default defineAsyncComponent(() => import("Website/node_modules/.pnpm/@[email protected][email protected][email protected][email protected]_@[email protected]_@types+no_axu5chfqddbh5cdcaa6tz2fp3a/node_modules/@nuxt/content/dist/runtime/components/ContentDoc.vue").then(r => r["default"] || r.default || r))',
template: null,
script: null,
scriptSetup: null,
styles: [],
customBlocks: [],
cssVars: [],
slotted: false,
shouldForceReload: [Function: shouldForceReload]
}
{
filename: 'Website/node_modules/.pnpm/@[email protected][email protected][email protected][email protected]_@[email protected]_@types+no_axu5chfqddbh5cdcaa6tz2fp3a/node_modules/@nuxt/content/dist/runtime/components/ContentDoc.vue',
source: 'import { defineAsyncComponent } from "vue"\n' +
'export default defineAsyncComponent(() => import("Website/node_modules/.pnpm/@[email protected][email protected][email protected][email protected]_@[email protected]_@types+no_axu5chfqddbh5cdcaa6tz2fp3a/node_modules/@nuxt/content/dist/runtime/components/ContentDoc.vue").then(r => r["default"] || r.default || r))',
template: null,
script: null,
scriptSetup: null,
styles: [],
customBlocks: [],
cssVars: [],
slotted: false,
shouldForceReload: [Function: shouldForceReload]
}
19 replies
NNuxt
Created by timmaier on 9/6/2024 in #❓・help
Nuxt build error (At least one <template> or <script> is required in a single file component)
I'm in the exact same situation here, with @nuxt/content. Here's the error incase it adds any extra context:
SyntaxError: At least one <template> or <script> is required in a single file component. Website/node_modules/.pnpm/@[email protected][email protected][email protected][email protected]_@[email protected]_@types+no_axu5chfqddbh5cdcaa6tz2fp3a/node_modules/@nuxt/content/dist/runtime/components/ContentDoc.vue
at Object.parse$2 [as parse] (node_modules\.pnpm\@[email protected]\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:1860:7)
at createDescriptor (/Website/node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected][email protected]/node_modules/@vitejs/plugin-vue/dist/index.mjs:64:43)
at transformMain (/Website/node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected][email protected]/node_modules/@vitejs/plugin-vue/dist/index.mjs:2396:34)
at Object.transform (/Website/node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected][email protected]/node_modules/@vitejs/plugin-vue/dist/index.mjs:2940:16)
at /Website/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:19918:40
SyntaxError: At least one <template> or <script> is required in a single file component. Website/node_modules/.pnpm/@[email protected][email protected][email protected][email protected]_@[email protected]_@types+no_axu5chfqddbh5cdcaa6tz2fp3a/node_modules/@nuxt/content/dist/runtime/components/ContentDoc.vue
at Object.parse$2 [as parse] (node_modules\.pnpm\@[email protected]\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:1860:7)
at createDescriptor (/Website/node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected][email protected]/node_modules/@vitejs/plugin-vue/dist/index.mjs:64:43)
at transformMain (/Website/node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected][email protected]/node_modules/@vitejs/plugin-vue/dist/index.mjs:2396:34)
at Object.transform (/Website/node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected][email protected]/node_modules/@vitejs/plugin-vue/dist/index.mjs:2940:16)
at /Website/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:19918:40
From my debugging, it seems to be something to do with async components.
19 replies