Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jit Mode? #37

Closed
codeitlikemiley opened this issue May 17, 2021 · 4 comments
Closed

Jit Mode? #37

codeitlikemiley opened this issue May 17, 2021 · 4 comments

Comments

@codeitlikemiley
Copy link

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
Copy link
Owner

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
Copy link

this is an ongoing issue also with hugo itself,

gohugoio/hugo#8343

@sid-r-singh
Copy link

sid-r-singh commented Jul 8, 2021

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:

  • In one terminal you run JIT
  • In another terminal you run hugo serve

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

@dirkolbrich
Copy link
Owner

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

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

No branches or pull requests

4 participants