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.

Next - Webpack5 JIT not rendering new values

See original GitHub issue

What version of Tailwind CSS are you using?

3.0.11

What build tool (or framework if it abstracts the build tool) are you using?

Next.js + Webpack on a monorepo

What version of Node.js are you using?

Next: 11.1.3. -> Webpack 5 mode Node: 14.16.1

What browser are you using? Chrome

What operating system are you using? MacOS

Reproduction URL

https://github.com/dailydotdev/apps -> You can choose the GitPod version from this repo.

Describe your issue

When we switched to webpack 5 we started seeing “new classes” and “arbitrary” values not reflecting on reload.

Example: Open > packages/shared/src/components/MainLayout.tsx and add an arbitrary value like h-[15px] on the header. (line 130).

You will see the classname gets added, but the styles don’t reflect this value. The same happens when you use classes that we haven’t used before in the project. (Like h-96 for instance)

What does work Often it does work when we stop the server and restart it. This is not solid.

A full fix that works:

  • Stop server
  • Remove .next cache
  • Restart server

Also when reverting back to webpack 4 it has zero issues to render these values.

Other impact This often also impacts builds that might miss these values for some reason, haven’t been able to re-create a stable reproduction of this yet.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:12
  • Comments:13

github_iconTop GitHub Comments

4reactions
drewlustrocommented, May 25, 2022

@dgurns – It’s well-documented that interpolated strings in tailwind classes do not work.

Capture 2022-05-25 - 000297

2reactions
dgurnscommented, May 27, 2022

Thank you, sorry I had missed that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unhandled Runtime Error next.js with tailwindcss
I solved this error. When looking at the documentation, the code should be changed to this: const MyApp = ({ Component, pageProps }) ......
Read more >
Just-in-Time Mode - Tailwind CSS
Tailwind CSS v2.1 introduces a new just-in-time compiler for Tailwind CSS that generates your styles on-demand as you author your templates instead of ......
Read more >
Webpack 5 Adoption - Next.js
Next.js has adopted webpack 5 as the default for compilation. We've spent a lot of effort into ensuring the transition from webpack 4...
Read more >
Next.js 13: The Game Changer? - Bits and Pieces
Next.js 13 was just released at the Next.js conf. It includes many new features, such as new routing, a new way to fetch...
Read more >
Ahead-of-time (AOT) compilation - Angular
The browser loads executable code so it can render the application immediately, without waiting ... By default, aot is set to true for...
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