tailwindcss: Cannot access the application: defu__WEBPACK_IMPORTED_MODULE_3__ is not a function

Version

@nuxtjs/tailwindcss: v5.1.2 nuxt: v2.15.8

Reproduction Link

https://codesandbox.io/s/tailwindcss-module-issue-defu-jqhlf6

It is working fine with @nuxtjs/tailwindcss v5.0.4. Another user seems to get the same error, as seen on StackOverflow: https://stackoverflow.com/questions/72409854/defu-webpack-imported-module-3-is-not-a-function-nuxt-auth

Steps to reproduce

  • Add @nuxtjs/auth-next dependency (version 5.0.0-1648802546.c9880dc)
  • Configure strategies in nuxt.config.js
  • Run dev server and open Nuxt application in the browser

What is Expected?

  • Application is running properly

What is actually happening?

  • Getting an error message: defu__WEBPACK_IMPORTED_MODULE_3__ is not a function

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 7
  • Comments: 15

Most upvoted comments

same issue! This problem occurs after project initialization.

Nuxt 2 + Typescript + tailwindCSS + chakraUI + yarn + Nuxt Content

$ nuxt

 FATAL  defu is not a function                                                                                                                          

  at ModuleContainer.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)

It seems to be a Problem with webpack and or the package defu. I’ve solved it by installing defu in version 5.0.1.

Still no fix by nuxt?

We’re facing this same issue with nuxt 2.17.0

defu__WEBPACK_IMPORTED_MODULE_3__ is not a function

how can i solve this problem

Getting the same error while installing @nuxt/content to an existing project.