question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. Itย collects links to all the places you might be looking at while hunting down a tough bug.

And, if youโ€™re still stuck at the end, weโ€™re happy to hop on a call to see how we can help out.

installModule doesn't work with nuxt 2 modules

See original GitHub issue

Environment

Operating System: Windows Node Version: v14.17.1 Nuxt Version: 2.15.8 Nitro Version: - Package Manager: npm@6.14.13 Builder: nxut2(webpack ) User Config: - Runtime Modules: - Build Modules: -

Reproduction

The latest version of @nuxt/kit has a problem with @nuxtjs/tailwindcss problem version : 3.0.0-rc.14

and seems like versions below 3.0.0-rc.14 work properly

Describe the bug

npm run dev doesnโ€™t work properly

Additional context

No response

Logs

npm run dev doesn't work properly as following below 

i Using default Tailwind CSS file from runtime/tailwind.css                                                                                                                        nuxt:tailwindcss 17:04:00

 FATAL  Cannot destructure property 'nuxt' of 'this' as it is undefined.                                                                                                                            17:04:00  

  at postcss8Module (node_modules\@nuxt\postcss8\dist\index.js:15:10)
  at installModule (/C:/Users/jun/Desktop/projects/nuxtjs2/node_modules/@nuxtjs/tailwindcss/node_modules/@nuxt/kit/dist/index.mjs:416:9)
  at async setup (/C:/Users/jun/Desktop/projects/nuxtjs2/node_modules/@nuxtjs/tailwindcss/dist/module.mjs:196:7)
  at async ModuleContainer.normalizedModule (/C:/Users/jun/Desktop/projects/nuxtjs2/node_modules/@nuxtjs/tailwindcss/node_modules/@nuxt/kit/dist/index.mjs:167:5)
  at async ModuleContainer.addModule (node_modules\@nuxt\core\dist\core.js:239:20)
  at async ModuleContainer.ready (node_modules\@nuxt\core\dist\core.js:51:7)
  at async Nuxt._init (node_modules\@nuxt\core\dist\core.js:478:5)

Issue Analytics

  • State:open
  • Created 10 months ago
  • Reactions:20
  • Comments:23

github_iconTop GitHub Comments

21reactions
oikewllcommented, Nov 18, 2022

I remove โ€œ@nuxtjs/tailwindcssโ€ , and follow Tailwind official website guide to resolved this issue:

https://tailwindcss.com/docs/guides/nuxtjs

20reactions
mulhooncommented, Nov 17, 2022

Iโ€™ve had the same since yesterday. A fresh install fails on yarn dev

Node: v16.13.0, MacOS Monterey 12.6

Setup:

create-nuxt-app v5.0.0
โœจ  Generating Nuxt.js project in nuxt-what
? Project name: nuxt-what
? Programming language: JavaScript
? Package manager: Yarn
? UI framework: Tailwind CSS
? Template engine: HTML
? Nuxt.js modules: Axios - Promise based HTTP client
? Linting tools: Prettier
? Testing framework: None
? Rendering mode: Universal (SSR / SSG)
? Deployment target: Server (Node.js hosting)
? Development tools: jsconfig.json (Recommended for VS Code if you're not using typescript)
? Continuous integration: None
? Version control system: Git
yarn run v1.22.17

Result:

$ nuxt
โ„น Using default Tailwind CSS file from runtime/tailwind.css                                                                                            nuxt:tailwindcss 10:25:00

 FATAL  Cannot destructure property 'nuxt' of 'this' as it is undefined.                                                                                                10:25:00

  at postcss8Module (node_modules/@nuxt/postcss8/dist/index.js:15:10)
  at installModule (node_modules/@nuxt/kit/dist/index.mjs:416:9)
  at async setup (node_modules/@nuxtjs/tailwindcss/dist/module.mjs:186:7)
  at async ModuleContainer.normalizedModule (node_modules/@nuxt/kit/dist/index.mjs:167:5)
  at async ModuleContainer.addModule (node_modules/@nuxt/core/dist/core.js:239:20)
  at async ModuleContainer.ready (node_modules/@nuxt/core/dist/core.js:51:7)
  at async Nuxt._init (node_modules/@nuxt/core/dist/core.js:478:5)


   โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
   โ”‚                                                                                 โ”‚
   โ”‚   โœ– Nuxt Fatal Error                                                            โ”‚
   โ”‚                                                                                 โ”‚
   โ”‚   TypeError: Cannot destructure property 'nuxt' of 'this' as it is undefined.   โ”‚
   โ”‚                                                                                 โ”‚
   โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
Read more comments on GitHub >

github_iconTop Results From Across the Web

Modules directory - Nuxt
The modules Propertyโ€‹โ€‹ Modules are Nuxt extensions which can extend the framework's core functionality and add endless integrations. Once you have installed the...
Read more >
Cannot use newly installed plugins (node modules) in Nuxt ...
It depends on the type of module and how it works but this one is nice because you only import it into the...
Read more >
Vuex "Module is not installed" warning using Nuxt.js
The warning suggests I install Vuex as a dev dependency, for some reason. Vuex is not installed as a package, because it comes...
Read more >
ES Modules ยท Nuxt Concepts
ES Modules. This guide helps explain what ES Modules are and how to make a Nuxt app (or upstream library) compatible with ESM....
Read more >
Integrating Nuxt Bridge into a Nuxt 2 Project | Cody Bontecou
Replace or remove modules that are not compatible with non-Nuxt 2 or are now obsolete due to their features now being built in....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found