Replies: 1 comment 1 reply
-
Resolved issue by downgrading the next-themes version from 0.3.0 to 0.2.1. Explanation: Steps taken:
Outcome: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Overview: While using the ThemeProvider from @shadcn/ui during development with pnpm dev, everything works as expected. However, when building the project using pnpm build, it encounters issues.
Reproduction Steps:
-Start the development server using pnpm dev.
-Observe that the application functions correctly without errors.
-Build the project using pnpm build.
-Observe that the build process encounters errors related to the ThemeProvider.
-Import RootLayout and ThemeProvider.
-Use ThemeProvider inside RootLayout with specific props.
-TypeScript raises an error indicating 'NextThemesProvider' cannot be used as a JSX component.
Expected Behavior: The application should build successfully without errors using pnpm build, just like it does during development with pnpm dev. TypeScript should recognize 'NextThemesProvider' as a valid JSX component and not raise an error.
Actual Behavior: During the build process with pnpm build, the application encounters errors related to the ThemeProvider from @shadcn/ui. These errors prevent the successful completion of the build process. TypeScript raises an error: 'NextThemesProvider' cannot be used as a JSX component.
Code Samples:
RootLayout.tsx:
theme-provider.tsx
TypeScript version: 4.9.5
React version: 18.2.0
Beta Was this translation helpful? Give feedback.
All reactions