Next.js Discord

Discord Forum

Client Component is not working on nestjs@latest

Answered
Black-backed Woodpecker posted this in #help-forum
Open in Discord
Black-backed WoodpeckerOP
I just installed a fresh nextjs latest app and tried to use the example client component from the website documentation. The event is not being trigger. useEffect is not triggering also the console.log("TEST") is appearing on terminal is there any issue regarding this

"use client";

import { useEffect, useState } from "react"; export default function Counter() { const [count, setCount] = useState(0); console.log("TEST"); useEffect(() => { console.log("TEST-USEEFFECT"); }, []); return ( <div> <p>You clicked {count} times</p> <button onClick={() => setCount(count + 1)}>Click me</button> </div> ); }
Answered by Black-backed Woodpecker
fixed by updating node version to v18.14.0
View full answer

1 Reply

Black-backed WoodpeckerOP
fixed by updating node version to v18.14.0
Answer