next-themes
next-themes copied to clipboard
i cant install next-theme on new verison next 14.0.0
i cant install next-theme on new verison next 14.0.0 im getting npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! node_modules/next npm ERR! next@"^14.0.0" from the root project npm ERR! peer next@"" from [email protected] npm ERR! node_modules/next-themes npm ERR! next-themes@"" from the root project npm ERR! Could not resolve dependency: npm ERR! peer next@"^12.2.5 || ^13" from [email protected] npm ERR! node_modules/next-auth npm ERR! next-auth@"^4.23.2" from the root project npm ERR! Conflicting peer dependency: [email protected] npm ERR! node_modules/next npm ERR! peer next@"^12.2.5 || ^13" from [email protected] npm ERR! node_modules/next-auth npm ERR! next-auth@"^4.23.2" from the root project and when i modified next version to 13.5.6 on package.json it install just fine and when i revert back the default value to package.json and try importing the themeProvider from "next-themes" in layout.js i got erros Createcontext must be in client mode
Weird, I created a new NextJS project the other day using Next 14 and it installed fine 😕
@Raoufbaa check and see if this helps. https://github.com/pacocoursey/next-themes/issues/194#issuecomment-1786974410
@Raoufbaa That install issue seems to be an issue with next-auth requiring Nextjs 13 or lower, not this package. Try updating your next-auth package to the newest version.
the next-auth is running on latest verison and i had same problem
is this already resolved? Im also encountering this error now. Thanks
See the example on how to use next-themes in the app-dir. Confirmed to be working as of next.js v14.2.0