Vite can't seem to find Tailwind theme

UI Components for Vue
Post Reply
Bhallu_
Posts: 1
Joined: 01 Oct 2021, 18:19

01 Oct 2021, 18:29

I have been trying to import Tailwind theme in my vue project. But for some reason it can't find the import of tailwind. Other import like bootstrap work properly

I copied the tailwind import from the doc.

Code: Select all

import { createPinia } from 'pinia'
import { createApp } from 'vue'
import App from './App.vue'
import PrimeVue from 'primevue/config'

import 'primevue/resources/themes/tailwind/tailwind-light/theme.css' // theme
import 'primevue/resources/primevue.min.css'                         //core css
import 'primeicons/primeicons.css'                                   //icons

const app = createApp(App)

app.use(createPinia())
app.use(PrimeVue)

app.mount('#app')
Whenever i try npm run dev and use the tailwind theme i get the following error.

Code: Select all

[vite] Internal server error: Failed to resolve import "primevue/resources/themes/tailwind/tailwind-light/theme.css" from "src\main.ts". Does the file exist?
  Plugin: vite:import-analysis
  File: C:/dev/vue_projs/vite-adminpanel/src/main.ts
  3  |  import App from "./App.vue";
  4  |  import PrimeVue from "primevue/config";
  5  |  import "primevue/resources/themes/tailwind/tailwind-light/theme.css";
     |          ^
  6  |  import "primevue/resources/primevue.min.css";
  7  |  import "primeicons/primeicons.css";
  
These are my dependencies.

Code: Select all

  
  "dependencies": {
    "pinia": "^2.0.0-rc.10",
    "primeicons": "^4.1.0",
    "primevue": "^3.7.2",
    "vue": "^3.2.16"
  },
  

tugce.kucukoglu
Posts: 560
Joined: 23 Oct 2020, 09:28

05 Nov 2021, 16:44

https://github.com/primefaces/primevue/issues/1614 Documentation is fixed. You need to update main.js

Post Reply

Return to “PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests