Skip to content
This repository has been archived by the owner on Oct 7, 2023. It is now read-only.

Cannot read properties of undefined (reading 'push') #10

Closed
5 tasks done
ymansurozer opened this issue Aug 26, 2023 · 0 comments · Fixed by #13
Closed
5 tasks done

Cannot read properties of undefined (reading 'push') #10

ymansurozer opened this issue Aug 26, 2023 · 0 comments · Fixed by #13

Comments

@ymansurozer
Copy link

ymansurozer commented Aug 26, 2023

Describe the bug

With Nuxt 3.7.0 release, I keep getting this error during nuxi prepare after installing 1.1.0:

 ERROR  Cannot read properties of undefined (reading 'push')                                                                                                                                                                     2:55:47 PM  

  at node_modules/@huntersofbook/naive-ui-nuxt/dist/module.mjs:35:38
  at node_modules/hookable/dist/index.mjs:48:66
  at Object.run (node_modules/hookable/dist/index.mjs:41:43)
  at node_modules/hookable/dist/index.mjs:48:56
  at async writeTypes (node_modules/@nuxt/kit/dist/index.mjs:2872:3)
  at async Object.run (node_modules/nuxi/dist/chunks/prepare.mjs:70:5)
  at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.51fb54b9.mjs:1644:5)
  at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.51fb54b9.mjs:1638:7)
  at async runMain$1 (node_modules/nuxi/dist/shared/nuxi.51fb54b9.mjs:1756:7)

When I add a null check to line 35 of module.mjs as below, it works fine:

tsConfig.compilerOptions.types?.push("naive-ui/volar");

But am I not sure if this is intended, although I see types can be undefined so probably adding the null check is the fix.

Reproduction

Simply doing nuxi prepare gives this error

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-12400F
    Memory: 5.90 GB / 15.82 GB
  Binaries:
    Node: 18.17.0 - C:\Program Files\nodejs\node.EXE
    npm: 9.6.7 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22621.2134.0), Chromium (116.0.1938.54)
    Internet Explorer: 11.0.22621.1

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant