NuxtN
Nuxt9mo ago
9 replies
fischi20

Project creation useHead infinite recursion

Whenever I create a new project, using nuxt.new, nuxi or create nuxt, on no changes I get a useHead infinite loop with the following error:

500 Maximum call stack size exceeded

at useHead (E:/Proggetti/NUXT/formli/node_modules/nuxt/dist/head/runtime/composables/v3.js:24:46)


and the same function bellow repeatedly. When I look into the path, the line seems to be off

export function useHead(input, options = {}) {
  const head = injectHead(options.nuxt);
  if (head) {
    return headCore(input, { head, ...options });
  } // < This is the problematic line
}


headCore is imported as follows in the same file

import {
  useHead as headCore,
} from "@unhead/vue";


the path varries, but the error remains the same no matter if I use npm, bun, pnpm. I did not try Deno.

Now, I assume this is for my machiene and I will try it on a second one since I found nothing about this anywhere, if it works on my work notebook I'm fine, I will update in the thread, but it would still possibly be relevant/interesting to figure out why

This are the creation scripts I tried and came to the same result
npm create nuxt@latest,pnpm create nuxt@latest , npx nuxi@latest create <project> or bun create nuxt@latest. I avoided modules or templates, so it's 100% a blank project

as for the installed versions:
- nuxt : ^3.16.2
- @unhead/vue: 2.0.2 (other libs used 2.0.8 from what I saw
- vue: ^3.5.13
- vue-router: ^4.5.0
Was this page helpful?