dirkolbrich / hugo-tailwindcss-starter-theme

Starter files for a Hugo theme with Tailwindcss
MIT License
402 stars 55 forks source link

Jit Mode? #37

Closed codeitlikemiley closed 1 year ago

codeitlikemiley commented 3 years ago

Hi i try to enable Jit Mode i got this error

Error: Error building site: POSTCSS: failed to transform "css/styles.css" (text/css): warn - You have enabled the JIT engine which is currently in preview.
warn - Preview features are not covered by semver, may introduce breaking changes, and can change at any time.
Error: ENOENT: no such file or directory, stat '/Users/uriah/Code/Hugo/new-theme/stdin'
    at Object.statSync (fs.js:1086:3)
    at trackModified (/Users/uriah/code/Hugo/new-theme/node_modules/tailwindcss/jit/lib/setupContext.js:233:26)
    at /Users/uriah/code/Hugo/new-theme/node_modules/tailwindcss/jit/lib/setupContext.js:728:38
    at /Users/uriah/code/Hugo/new-theme/node_modules/tailwindcss/jit/index.js:35:47
    at LazyResult.runOnRoot (/Users/uriah/.fnm/node-versions/v14.16.0/installation/lib/node_modules/postcss/lib/lazy-result.js:303:16)
    at LazyResult.runAsync (/Users/uriah/.fnm/node-versions/v14.16.0/installation/lib/node_modules/postcss/lib/lazy-result.js:355:26)
    at async Promise.all (index 0) {
  errno: -2,
  syscall: 'stat',
  code: 'ENOENT',
  path: '/Users/uriah/Code/Hugo/new-theme/stdin'
}

also have this with my old projects...

I would love to know if someone already has solution on this with the postcss

Looking forward for an answer thanks

dirkolbrich commented 3 years ago

I have not used the TaiwindCSS JIT setup. Your error is hard to debug without extra information. To me it seems like a path issue.

Error: ENOENT: no such file or directory, stat '/Users/uriah/Code/Hugo/new-theme/stdin'

Please describe every single step you did during setup so that this error is reproducible or provide an example repo I can investigate.

goldcoders commented 3 years ago

this is an ongoing issue also with hugo itself,

https://github.com/gohugoio/hugo/issues/8343

sid-r-singh commented 3 years ago

Here is an excellent workaround to implement JIT. I used the word workaround because people at Hugo are working on finding a perfect solution, as mentioned here gohugoio/hugo#8343.

Here is how the workaround works:

You use a new Tailwind class in your theme -> JIT updates css -> Hugo reloads CSS as usually (livereload)

dirkolbrich commented 2 years ago

Tailwind JIT mode should now be working with the update to TailwindCSS 3.