Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

Not able to get to work in Vite #18

Closed
tauzN opened this issue Mar 15, 2021 · 7 comments
Closed

Not able to get to work in Vite #18

tauzN opened this issue Mar 15, 2021 · 7 comments

Comments

@tauzN
Copy link

tauzN commented Mar 15, 2021

I am not able to get it to work in Vite with Vue. This might be a problem with Vite.
I think the error is related to some relative path mapping in Vite.
It was working as expected with "regular" tailwindcss

Node 15.11.0
Vite 2.0.5
Vue 3.0.6
tailwindcss/jit 0.1.0

// index.css
@tailwind base;
@tailwind components;
@tailwind utilities;

The project starts as expected

//Console output

PS D:\git\Journalizer 2> npm run dev

> journalizer2@2.0.0 dev
> vite

Pre-bundling dependencies:      
  vue
  dayjs
  dayjs/locale/da
  dayjs/plugin/relativeTime     
  dayjs/plugin/customParseFormat
  (...and 6 more)
(this will be run only when your dependencies or config have changed)

  vite v2.0.5 dev server running at:

  > Network:  https://192.168.87.101:443/
  > Local:    https://localhost.test:443/

  ready in 1049ms.

but throws these errors when accessing the webserver in the browser:

18.40.22 [vite] Internal server error: ENOENT: no such file or directory, stat '/git/Journalizer%202/src/index.css'
  Plugin: vite:css
  File: D:/git/Journalizer 2/src/index.css
      at Object.statSync (node:fs:1142:3)
      at trackModified (D:\git\Journalizer 2\node_modules\@tailwindcss\jit\src\lib\setupContext.js:187:26)
      at D:\git\Journalizer 2\node_modules\@tailwindcss\jit\src\lib\setupContext.js:652:38
      at D:\git\Journalizer 2\node_modules\@tailwindcss\jit\src\index.js:34:49
      at LazyResult.runOnRoot (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:303:16)
      at LazyResult.runAsync (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:355:26)
      at LazyResult.async (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:205:30)
      at LazyResult.then (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:190:17)
18.40.22 [vite] Internal server error: ENOENT: no such file or directory, stat '/git/Journalizer%202/tailwind.config.js' 
  Plugin: vite:css
  File: D:/git/Journalizer 2/src/App.vue?vue&type=style&index=0&lang.postcss
      at Object.statSync (node:fs:1142:3)
      at trackModified (D:\git\Journalizer 2\node_modules\@tailwindcss\jit\src\lib\setupContext.js:187:26)
      at D:\git\Journalizer 2\node_modules\@tailwindcss\jit\src\lib\setupContext.js:652:38
      at D:\git\Journalizer 2\node_modules\@tailwindcss\jit\src\index.js:34:49
      at LazyResult.runOnRoot (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:303:16)
      at LazyResult.runAsync (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:355:26)
      at LazyResult.async (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:205:30)
      at LazyResult.then (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:190:17)
18.40.22 [vite] Internal server error: ENOENT: no such file or directory, stat '/git/Journalizer%202/tailwind.config.js' 
  Plugin: vite:css
  File: D:/git/Journalizer 2/src/views/Auth.vue?vue&type=style&index=0&lang.postcss
      at Object.statSync (node:fs:1142:3)
      at trackModified (D:\git\Journalizer 2\node_modules\@tailwindcss\jit\src\lib\setupContext.js:187:26)
      at D:\git\Journalizer 2\node_modules\@tailwindcss\jit\src\lib\setupContext.js:652:38
      at D:\git\Journalizer 2\node_modules\@tailwindcss\jit\src\index.js:34:49
      at LazyResult.runOnRoot (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:303:16)
      at LazyResult.runAsync (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:355:26)
      at LazyResult.async (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:205:30)
      at LazyResult.then (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:190:17)
18.40.22 [vite] Internal server error: ENOENT: no such file or directory, stat '/git/Journalizer%202/tailwind.config.js' 
  Plugin: vite:css
  File: D:/git/Journalizer 2/src/views/AuthEnd.vue?vue&type=style&index=0&lang.postcss
      at Object.statSync (node:fs:1142:3)
      at trackModified (D:\git\Journalizer 2\node_modules\@tailwindcss\jit\src\lib\setupContext.js:187:26)
      at D:\git\Journalizer 2\node_modules\@tailwindcss\jit\src\lib\setupContext.js:652:38
      at D:\git\Journalizer 2\node_modules\@tailwindcss\jit\src\index.js:34:49
      at LazyResult.runOnRoot (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:303:16)
      at LazyResult.runAsync (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:355:26)
      at LazyResult.async (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:205:30)
      at LazyResult.then (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:190:17)
18.40.22 [vite] Internal server error: ENOENT: no such file or directory, stat '/git/Journalizer%202/tailwind.config.js' 
  Plugin: vite:css
  File: D:/git/Journalizer 2/src/views/Config.vue?vue&type=style&index=0&lang.postcss
      at Object.statSync (node:fs:1142:3)
      at trackModified (D:\git\Journalizer 2\node_modules\@tailwindcss\jit\src\lib\setupContext.js:187:26)
      at D:\git\Journalizer 2\node_modules\@tailwindcss\jit\src\lib\setupContext.js:652:38
      at D:\git\Journalizer 2\node_modules\@tailwindcss\jit\src\index.js:34:49
      at LazyResult.runOnRoot (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:303:16)
      at LazyResult.runAsync (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:355:26)
      at LazyResult.async (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:205:30)
      at LazyResult.then (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:190:17)
18.40.22 [vite] Internal server error: ENOENT: no such file or directory, stat '/git/Journalizer%202/tailwind.config.js' 
  Plugin: vite:css
  File: D:/git/Journalizer 2/src/views/Listitem/Listitem.vue?vue&type=style&index=0&scoped=true&lang.postcss
      at Object.statSync (node:fs:1142:3)
      at trackModified (D:\git\Journalizer 2\node_modules\@tailwindcss\jit\src\lib\setupContext.js:187:26)
      at D:\git\Journalizer 2\node_modules\@tailwindcss\jit\src\lib\setupContext.js:652:38
      at D:\git\Journalizer 2\node_modules\@tailwindcss\jit\src\index.js:34:49
      at LazyResult.runOnRoot (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:303:16)
      at LazyResult.runAsync (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:355:26)
      at LazyResult.async (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:205:30)
      at LazyResult.then (D:\git\Journalizer 2\node_modules\postcss\lib\lazy-result.js:190:17)
@tauzN
Copy link
Author

tauzN commented Mar 15, 2021

I can access
https://localhost.test/src/App.vue?vue&type=style&index=0
in the browser, but not with &lang params
https://localhost.test/src/App.vue?vue&type=style&index=0&lang.css
Not related

@MohammadS3dd
Copy link

MohammadS3dd commented Mar 15, 2021

can you get it to generate classes in a Css file?
nothing works for me with Vite . it's like regular tailwind

@bramaudi
Copy link

I got the same error with Snowpack, maybe tailwindcss jit is still incompatible with esbuild-based bundler

@tauzN
Copy link
Author

tauzN commented Mar 15, 2021

I can confirm that it works as expected when renaming project folder to 'Journalizer-2' (no space)
Better issue description here: #22

@MohammadS3dd
Copy link

I can confirm that it works as expected when renaming project folder to 'Journalizer-2' (no space)

is it working with vue + vite ? does it generate chained classes?

@bramaudi
Copy link

I can confirm that it works as expected when renaming project folder to 'Journalizer-2' (no space)

Not sure about that, my project folder name is in single word, i'm using Linux btw.

@tauzN
Copy link
Author

tauzN commented Mar 15, 2021

This seem unrelated to Vite. This issue description is more fitting: #22

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants