mantine-theme-builder icon indicating copy to clipboard operation
mantine-theme-builder copied to clipboard

TypeError in NextJS: <<Container.extend is not a function>>

Open Jawisr opened this issue 1 year ago • 1 comments

Hi team, i have just copied the theme.ts into my project and passed to the MantineProvider component, first time I render the page i receive the following error in turbopack:

TypeError: {imported module [project]/nodemodules/.pnpm/@[email protected]_@[email protected]@19.0.0__@[email protected]@[email protected][email protected]/nodemodules/@mantine/core/esm/components/Container/Container.mjs [app-rsc] (ecmascript)}.Container.extend is not a function

[project]/app/styles/theme.ts [app-rsc] (ecmascript)

I tried commenting the Container object in the theme but the next component: Checkbox.extend throws the same error.

Jawisr avatar Jan 23 '25 16:01 Jawisr

@Jawisr In the theme.ts file, add "use client" as the first line and it will work as expected.

Image

Abhishek-S-Lal avatar Jan 23 '25 16:01 Abhishek-S-Lal