Issue after updating to Next 15 and React 19: Type Error on Build
Unanswered
Polar bear posted this in #help-forum
Polar bearOP
Hey, I'm wondering if anyone can shine a light on this before I lose my mind. I've updated to Next 15 and React 19 in my project (it's not a vital project and wanted to test it out).
When I build the app I get this error
@vytl/web:build: Type error: Type '{ children: ReactNode; }' does not satisfy the constraint 'LayoutProps'.
@vytl/web:build: Types of property 'children' are incompatible.
@vytl/web:build: Type 'import("/vercel/path0/apps/web/node_modules/@types/react/index").ReactNode' is not assignable to type 'React.ReactNode'.
This is my Marketplace Layout
import { redirect } from 'next/navigation';
import React from 'react';
import { getUserFeature } from '../../../services/user.service';
const MarketplaceLayout = async ({ children }: { children: React.ReactNode }) => {
const isFeatureEnabled = await getUserFeature('marketplace');
if (!isFeatureEnabled) {
redirect('/profile');
}
return #Unknown Channel{children}</>;
};
export default MarketplaceLayout;
Any help would be greatly appreciated!
"@types/react": "19.0.2",
"@types/react-dom": "19.0.2",
"react": "19.0.0",
"next": "15.1.2",
When I build the app I get this error
@vytl/web:build: Type error: Type '{ children: ReactNode; }' does not satisfy the constraint 'LayoutProps'.
@vytl/web:build: Types of property 'children' are incompatible.
@vytl/web:build: Type 'import("/vercel/path0/apps/web/node_modules/@types/react/index").ReactNode' is not assignable to type 'React.ReactNode'.
This is my Marketplace Layout
import { redirect } from 'next/navigation';
import React from 'react';
import { getUserFeature } from '../../../services/user.service';
const MarketplaceLayout = async ({ children }: { children: React.ReactNode }) => {
const isFeatureEnabled = await getUserFeature('marketplace');
if (!isFeatureEnabled) {
redirect('/profile');
}
return #Unknown Channel{children}</>;
};
export default MarketplaceLayout;
Any help would be greatly appreciated!
"@types/react": "19.0.2",
"@types/react-dom": "19.0.2",
"react": "19.0.0",
"next": "15.1.2",