Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

TypeError: defu is not a function in a fresh installation #531

Closed
0xcrypto opened this issue May 7, 2022 · 2 comments · Fixed by #538
Closed

TypeError: defu is not a function in a fresh installation #531

0xcrypto opened this issue May 7, 2022 · 2 comments · Fixed by #538
Labels
type: bug 🐛 Something isn't working type: contributions welcome 💚 Contributions are welcome!

Comments

@0xcrypto
Copy link

0xcrypto commented May 7, 2022

const defu = require('defu')

defu is incorrectly imported in above mentioned line and throws error in a fresh installation.

vi@vi:~/source/example-app$ npm run dev

> [email protected] dev
> nuxt


 FATAL  defu is not a function                                                                                                                                                             18:36:00

  at module.exports (node_modules/@chakra-ui/nuxt/lib/module.js:20:32)
  at ModuleContainer.addModule (node_modules/@nuxt/core/dist/core.js:239:34)
  at node_modules/@nuxt/utils/dist/utils.js:639:43
  at async ModuleContainer.ready (node_modules/@nuxt/core/dist/core.js:55:5)
  at async Nuxt._init (node_modules/@nuxt/core/dist/core.js:478:5)


   ╭───────────────────────────────────────╮
   │                                       │
   │   ✖ Nuxt Fatal Error                  │
   │                                       │
   │   TypeError: defu is not a function   │
   │                                       │
   ╰───────────────────────────────────────╯

It needs to be destructured:

const { defu } = require('defu') // works fine
@0xcrypto
Copy link
Author

0xcrypto commented May 7, 2022

Manually installing defu@^2.0.4 works too.

@ajain-1
Copy link

ajain-1 commented Aug 7, 2022

Just did a fresh setup with Nuxt and I'm still getting this issue. Fixed it by editing the import.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug 🐛 Something isn't working type: contributions welcome 💚 Contributions are welcome!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants