next-themes icon indicating copy to clipboard operation
next-themes copied to clipboard

i cant install next-theme on new verison next 14.0.0

Open Raoufbaa opened this issue 1 year ago • 4 comments

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

Raoufbaa avatar Oct 29 '23 07:10 Raoufbaa

Weird, I created a new NextJS project the other day using Next 14 and it installed fine 😕

barrymichaeldoyle avatar Oct 30 '23 16:10 barrymichaeldoyle

@Raoufbaa check and see if this helps. https://github.com/pacocoursey/next-themes/issues/194#issuecomment-1786974410

sandrinjoy avatar Oct 31 '23 10:10 sandrinjoy

@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.

JamesBream avatar Nov 07 '23 17:11 JamesBream

the next-auth is running on latest verison and i had same problem

Raoufbaa avatar Nov 07 '23 18:11 Raoufbaa

is this already resolved? Im also encountering this error now. Thanks

fad16papa avatar Apr 16 '24 16:04 fad16papa

See the example on how to use next-themes in the app-dir. Confirmed to be working as of next.js v14.2.0

trm217 avatar Apr 22 '24 11:04 trm217