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.

[bug] Styles not being applied in new nextjs apps

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

0.0.26

Current Behavior

Trying to render a simple <Box /> componenet does not inject styles in the ppage. Classes on dom nodes are added but not styles are not applied.

Expected Behavior

The components should be styled.

Steps To Reproduce

Code -

On stackblitz - does not work

On degen Playground - works

import { Box, Button } from 'degen'

export function Header() {
  return (
    <Box as='header' padding='16' backgroundColor='yellow'>
      <Box padding='16' backgroundColor='black' color='white' fontFamily='mono'>
        <Button>Hello World</Button>
      </Box>
    </Box>
  )
}

Anything else?

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
heyitsarpitcommented, Dec 16, 2021

@CodeAunt Refer to this stackbltz example. In your code you seem to have missed importing the styles import 'degen/styles';. ThemeProvider is one of two imports.

1reaction
heyitsarpitcommented, Dec 15, 2021

Hi, I got the same problem, no style are applied to the components. Have you fix it?

@CodeAunt Yeah, I realised that I never wrapped the app with the ThemeProvider

Read more comments on GitHub >

github_iconTop Results From Across the Web

Styles not applied in first loading correctly with NextJS #30410
When using SX prop I seem to be getting an issue when deploying the application where a lot of the styles are loaded...
Read more >
Next.js and Styled-Components: style loading issue
js app but can't get the styles to load properly? This is because the server-side rendering does not fetch the styles before rendering...
Read more >
react-hydration-error - Next.js
In general this issue is caused by using a specific library or application code that is relying on something that could differ between...
Read more >
Debugging Tailwind CSS and Next.js - LogRocket Blog
If you configure the content paths with Next the way you did with a React app, it will still not work. This is...
Read more >
Tailwind CSS classes is not working in my project?
This error is due to tailwind not finding any classes to scan in what it 'thinks' is your HTML code directories.
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