Nuxt build error (At least one <template> or <script> is required in a single file component)
After upgrading with
nuxi upgrade --force
.
On cloudflare pages the error looks like this:
9 Replies
Here's some debug during dev
500
If I update all packages to latest version in package.json. Running dev server spits out:
And do you have at least one template or script tag in the mentioned SFC?
It looks like your
Callout.vue
file is empty.
Make sure the file includes at least one <template>
or <script>
block, as required for single file components.Hey thanks for the responses.
Callout.vue is from nuxt ui pro package. There is no empty script tag. Project was working fine in same state before nuxi upgrade.
After updating again I get
Did you change the ā¦?
I'm in the exact same situation here, with @nuxt/content. Here's the error incase it adds any extra context:
From my debugging, it seems to be something to do with async components.
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:
@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.
Not at the computer just now but will do a bit more debugging later @amplitudes
these are my modules
Here's a gist with the full nuxt config:
https://gist.github.com/timmaier/9d6f8d2b42d25f3c5427ac85eb941316
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
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 š¤
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 erroringThanks mate this got me past the error too now I'm getting a memory issue when building š