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.

Style problems when visiting the page for the first time after next.js-twind build

See original GitHub issue

After next.js-twind is build, when you visit the page for the first time.

the style cannot be loaded immediately, and there will be a short process of no style.

this problem will not appear when it is developed locally, but it will appear after build.


This is an example ↓

https://user-images.githubusercontent.com/63690944/167306258-884c8bc0-0e86-4a1a-a7e7-1feffc818ab0.mov


If you look at it carefully, you will see that at the beginning, This is Twind! The text is on the left

But that was only for a moment, and then style came along


This is the related code image ↓

126941652029239_ pic


This is a simple code example, you may need to download it locally for testing. ↓

https://codesandbox.io/s/nextjs-twind-prod-transition-error-t9r2i8

# step 1
yarn
# step 2
yarn build
# step 3
yarn start

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
sastancommented, May 9, 2022

I can reproduce the issue. It seems the the HTML response those not contain any twind style (the tag is empty). The cause may very likely be the the tw calls outside of render. But I do not know why ATM. Could you try v1 (it is compatible with tailwind v3)? There this issue is certainly fixed.

https://codesandbox.io/s/nextjs-twind-prod-transition-error-forked-y2chi3?file=/src/pages/index.tsx

0reactions
sastancommented, Oct 4, 2022

The vscode and typescript plugins are not yet compatible with twind@next.

Closing for now. Please re-open if you need to.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pages render without styles for a brief second #15642 - GitHub
Bug report Describe the bug Pages render without any styles for a brief second before the CSS is ... This render problem only...
Read more >
Build and Deploy a Premium Next JS React Website - YouTube
In this video, you're going to build and deploy a professional Next.js landing page !
Read more >
Next.js Practical Introduction Pt. 2: Styling and Theming - Auth0
Learn how to handle styling and theming with Next.js to build server-side rendered React applications. Part 2 shows techniques for styling ...
Read more >
How to Create Pages in Next.js with Static & Dynamic Data
We'll look at how we can use the Next.js data fetching APIs to create both static and dynamic pages. What's Inside. Why is...
Read more >
Building a Blog with Next.js - CSS-Tricks
In this article, we will use Next.js to build a static blog framework with the design and structure inspired by Jekyll.
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