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

[NEXT-667] Next 13 + Tailwind hot-reload of classes doesn't work in Firefox Browser #44782

Closed
1 task done
kleinesNugget opened this issue Jan 11, 2023 · 11 comments
Closed
1 task done
Labels
bug Issue was opened via the bug report template. linear: next Confirmed issue that is tracked by the Next.js team.

Comments

@kleinesNugget
Copy link

kleinesNugget commented Jan 11, 2023

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Pro
Binaries:
  Node: 19.3.0
  pnpm: N/A
Relevant packages:
  next: 13.1.2-canary.2 // Canary 3 and 4 wouldn't render a page for me, so I couldn't try with those. Have heard this issue from others as well though.
  eslint-config-next: 13.1.1
  react: 18.2.0
  react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue

https://github.com/vercel/app-playground

To Reproduce

  • Grab latest version of Next.js (I'm using the playground example)
  • It seems to be irrelevant whether you are using the app-directory or not
  • It also seems to be irrelevant whether you are using turbopack or not
  • Load project, go to /streaming
  • In your editor, go to Product.tsx and edit a class with a width class w-* (go to line 75)
  • Start the server with npm run dev
  • Swap w-1/3 for w-6/12 save and wait for hot-reload (Use Firefox as your the Browser)
  • You won't see your new class applied, element will break due to class not being applied
  • Go back to editor and try now w-10/12, wait for hot-reload. Same result as above.
  • Set it now to w-6/12 and manually reload, you will see your class now (and it seems to be caching this class now)
  • If you repeat the steps above w-6/12 won't fail anymore because it seems to be cached now somehow

Describe the Bug

Pretty much the exact same bug has already been brought up and fixed, but it doesn't seem like the fix has worked for Firefox users, as they still complain on the issue and one user figured that it seems to be related to Firefox and I could confirm that the issue doesn't appear on Chrome. (#43878)

Hot reloading of Tailwind CSS in Firefox when you change classes in your code doesn't work.
Only works after you apply a new class and manually reload the page or restart.
Hot reloading of the class will only work if it existed before, but not if it has to be generated.

Expected Behavior

Swapping Tailwind classes from elements should work in Firefox when hot-reloading and properly generate them accordingly.

Which browser are you using? (if relevant)

Not working in Firefox 108.0.2 (64-bit); Working in Chrome 110.0.5481.30 (Offizieller Build) dev (64-Bit)

How are you deploying your application? (if relevant)

next run dev

NEXT-667

@kleinesNugget kleinesNugget added the bug Issue was opened via the bug report template. label Jan 11, 2023
@emi2k01
Copy link

emi2k01 commented Jan 12, 2023

I use firefox and this happens to me too.

While trying Chrome, I noticed that, after a fast-refresh, the scroll position was reset because the styles are removed for a moment. Not sure how related this is to this issue.

@kleinesNugget
Copy link
Author

I use firefox and this happens to me too.

While trying Chrome, I noticed that, after a fast-refresh, the scroll position was reset because the styles are removed for a moment. Not sure how related this is to this issue.

I've also noticed Chrome completely turning white for a split-second when hot-reloading, which I didn't ever recall in any version of next on Firefox. Thought I just overlooked it, but I guess it somewhat is different.

@idebeijer
Copy link

Since Next 13.0.5 fast-refresh doesn't actually seem to refresh the tailwind classes on Firefox. I've tried all versions of Next after 13.0.4 (not the canary releases), but no luck.

I've tried it on the default release of Firefox and on the Developer Edition of Firefox but it only seems to work when I use Chrome or Safari.

So I guess downgrade to 13.0.4 for now if you want it to properly fast-refresh.

@clovis-rosa
Copy link

So I guess downgrade to 13.0.4 for now if you want it to properly fast-refresh.

Just a heads up to all of you. Even if you downgrade to the v13.0.4, while you're developing the window(browser) will be updated when you change your CSS, but if you watch close in Firefox, inside the devtools, that specific CSS value that you just changed, was not updated. You can try and see it right now with any Next, React, Vite versions or whatever.

I'm not sure if it is a bug or a feature that just works on Chrome.

8 months I reported it to the Firefox bug team, but no updates so far...
Bugzilla issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1776831

Here a vanilla js example that was made by the Firefox team to show it. Open in both browsers and watch the devtools behaviour: https://bug1776831.bmoattachments.org/attachment.cgi?id=9283174

The reason I'm posting it here is first, to make you all aware, and second, I'm not sure if it's related or/if you will be able to fix it in the React side.

Hope it helps! ✌️

@zcorpan
Copy link

zcorpan commented Feb 18, 2023

Thanks @clovis-rosa, I've commented in the Firefox bug that it might cause this issue.

@urbenlegend
Copy link

This issue seems to be independent of TailwindCSS when using appDir. I simply created a new project using create-next-app with appDir enabled and then tried changing the --border-radius variable from 12px to 50px. Nothing changed on the site in Firefox, but it changed in Chromium. This does not happen when I don't use appDir.

@quick007
Copy link

currently experiencing in chrome as well

@timneutkens timneutkens added the linear: next Confirmed issue that is tracked by the Next.js team. label Feb 27, 2023
@timneutkens timneutkens changed the title Next 13 + Tailwind hot-reload of classes doesn't work in Firefox Browser [NEXT-667] Next 13 + Tailwind hot-reload of classes doesn't work in Firefox Browser Feb 27, 2023
@timneutkens timneutkens closed this as not planned Won't fix, can't repro, duplicate, stale Feb 28, 2023
@Victor239
Copy link

What does "closed as not planned" mean here? This will be a permanent bug?

@timneutkens
Copy link
Member

Bug in our sync to linear and back, it was closed as a duplicate of another issue.

It's closed as a duplicate of #43396.

@Victor239
Copy link

Ah I see, thanks!

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. linear: next Confirmed issue that is tracked by the Next.js team.
Projects
None yet
Development

No branches or pull requests

9 participants