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.

tailwind triggers `nuxt.config` import protection

See original GitHub issue

Environment

RootDir: /home/supp/code/test Nuxt project info:


  • Operating System: Linux
  • Node Version: v17.4.0
  • Nuxt Version: 3.0.0-27383858.03cc191
  • Package Manager: yarn@1.22.17
  • Bundler: Vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-vaufyy?devtoolsheight=33&file=package.json

Describe the bug

I just create a new clear project with npx nuxi create and tried to run yarn dev

Errors compilng: nuxt3/nuxt cannot be imported directly. Instead, import runtime Nuxt composables from #app or #imports. [importing /home/supp/code/test/node_modules/nuxt3/dist/meta/runtime/plugin from virtual:/home/supp/code/test/.nuxt/plugins/server.mjs]

This module cannot be imported in the Vue part of your app. [importing /home/supp/code/test/node_modules/@nuxt/nitro/dist/runtime/app/nitro.client.mjs from virtual:/home/supp/code/test/.nuxt/plugins/server.mjs]

Additional context

No response

Logs

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:31 (15 by maintainers)

github_iconTop GitHub Comments

109reactions
danielroecommented, Jan 24, 2022

For now, remove the nuxt.config scanning from your tailwind config.

   content: [
     "./components/**/*.{vue,js}",
     "./layouts/**/*.vue",
     "./pages/**/*.vue",
     "./app.vue",
     "./plugins/**/*.{js,ts}",
-    "./nuxt.config.{js,ts}"
   ],
   theme: {
     extend: {
       fontFamily: {
         vazir: ['Vazir']
       }
     },
   },
   plugins: [],
 }

Do you think you need Tailwind to scan your nuxt.config?

18reactions
misaoncommented, Jan 24, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Install Tailwind CSS with Nuxt.js
Using npm, install tailwindcss and its peer dependencies, as well as @nuxt/postcss8 , and then run the init command to generate the tailwind.config.js...
Read more >
Creating a free JAMstack website with Nuxt.js, Tailwind CSS ...
After finishing up my Java development bootcamp, I decided to begin developing a professional presence online by creating a website.
Read more >
Nuxtjs - TailwindCSS: Install Tailwind CSS with Nuxt.js - Morioh
Clone this repository; Install dependencies using yarn install; Prepare for development using yarn dev:setup; Start development server using yarn dev. Features.
Read more >
Nuxtjs v3 and Tailwindcss v3 PostCSS@8 not compatible
Import your css in app.vue . (optional) in previous version they recommend us to import tailwindcss in app.vue instead of nuxt.config.
Read more >
Nuxt 3 + Tailwind + Eslint + i18n + Sentry Starter - Localazy
Nuxt 3 + Tailwind + Eslint + i18n + Sentry Starter ; // .eslintrc.js module.exports · env ; // nuxt.config.ts import { defineNuxtConfig...
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