Next.js Discord

Discord Forum

Next 15 (app dir): problem with UI kit: works in Vite, but not Next.js

Answered
Britannia Petite posted this in #help-forum
Open in Discord
Avatar
Britannia PetiteOP
Hey folks,
I started tinkering with latest Next 15, that I want to use with Polaris UI kit. Technically speaking it is not compatibile yet with React 19, but it does work in my Vite project. Suprising, but it doesn't in Next. I assume it might be caused by server components. Could someone point me in the right direction: if this is solvable from my side, or I need to wait for UI kit devs to fix it?

Here's my layout.tsx, and below you will see the error
Image
Answered by averydelusionalperson
You prolly need to take create a wrapper for the AppProvider which is a client component, you mark it as client using use client, and use that wrapper inside layout.tsx.

This is what I assume the issue is from the error.
View full answer

4 Replies

Avatar
Britannia PetiteOP
Image
Avatar
You prolly need to take create a wrapper for the AppProvider which is a client component, you mark it as client using use client, and use that wrapper inside layout.tsx.

This is what I assume the issue is from the error.
Answer
Avatar
Britannia PetiteOP
Yup, that was it, thank you!