Skip to content

nodeReferences is undefined when running nuxt build (with v0.12) #519

@davidsandoz

Description

@davidsandoz

🐛 The bug

Starting with v0.12.0 (also with v0.12.1), the build of my Nuxt 3 project doesn't work any more. I'm getting the following error:

 ERROR  Cannot read properties of undefined (reading 'push')
    at node_modules/@nuxt/scripts/node_modules/@nuxt/kit/dist/index.mjs:1286:22
    at node_modules/hookable/dist/index.mjs:48:66
    at node_modules/hookable/dist/index.mjs:48:56
    at async _generateTypes (node_modules/@nuxt/kit/dist/index.mjs:3528:3)
    at async writeTypes (node_modules/@nuxt/kit/dist/index.mjs:3563:37)
    at async Object.run (node_modules/@nuxt/cli/dist/chunks/prepare.mjs:49:5)
    at async runCommand (node_modules/citty/dist/index.mjs:316:16)
    at async runCommand (node_modules/citty/dist/index.mjs:307:11)
    at async runMain (node_modules/citty/dist/index.mjs:445:7) 

node_modules/@nuxt/scripts/node_modules/@nuxt/kit/dist/index.mjs:1286:22 matches a push on nodeReferences.

I'm aware that the issues occurs in @nuxt/kit, but I wonder if the solution is about picking a correct version of it so that it works with Nuxt 3 or Nuxt 4.

In the StackBlitz reproduction project, the error is not the same. But if you download the project locally and try to run it, then you get the same error.

🛠️ To reproduce

https://stackblitz.com/edit/nuxt-starter-e3475ree

🌈 Expected behavior

No errors when building/running the project.

ℹ️ Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions