Mantine framework support?
d9k opened this issue · comments
Dmitry commented
Tried to run mantine 6.0.21 with ultra.
When I tried to add <MantineProvider>
I've got an error:
TypeError: Cannot read properties of null (reading 'useContext') at n.useContext (https://esm.sh/stable/react@18.2.0/denonext/react.mjs:2:6234)
at _r (https://esm.sh/v132/@mantine/styles@6.0.21/denonext/styles.mjs:2:18339) at renderWithHooks (https://esm.sh/v132/react-dom@18.2.0/denonext/server.developme
nt.js:9780:24) at renderIndeterminateComponent (https://esm.sh/v132/react-dom@18.2.0/denonext/ser
ver.development.js:9837:23) at renderElement (https://esm.sh/v132/react-dom@18.2.0/denonext/server.development
.js:9997:15) at renderNodeDestructiveImpl (https://esm.sh/v132/react-dom@18.2.0/denonext/server
.development.js:10102:17)
at renderNodeDestructive (https://esm.sh/v132/react-dom@18.2.0/denonext/server.dev
elopment.js:10082:22)
at renderContextProvider (https://esm.sh/v132/react-dom@18.2.0/denonext/server.dev
elopment.js:9974:11
at renderElement (https://esm.sh/v132/react-dom@18.2.0/denonext/server.development
.js:10041:17)
at renderNodeDestructiveImpl (https://esm.sh/v132/react-dom@18.2.0/denonext/server
.development.js:10102:17)
importMap.json
:
{
"imports": {
"@mantine/core": "https://esm.sh/@mantine/core@6.0.21",
"@mantine/hooks": "https://esm.sh/@mantine/hooks@6.0.21",
"react": "https://esm.sh/react@18.2.0?dev",
"react/": "https://esm.sh/react@18.2.0/",
"react-dom": "https://esm.sh/react-dom@18.2.0",
"react-dom/server": "https://esm.sh/react-dom@18.2.0/server?dev",
"react-dom/client": "https://esm.sh/react-dom@18.2.0/client?dev",
"wouter": "https://esm.sh/wouter@2.9.2?external=react",
"wouter/static-location": "https://esm.sh/wouter@2.9.2/static-location?external=react",
"@tanstack/react-query": "https://esm.sh/@tanstack/react-query@4.2.3?external=react",
"react-helmet-async": "https://esm.sh/react-helmet-async@1.3.0?external=react",
"ultra/": "https://deno.land/x/ultra@v2.3.8/"
}
}
import { MantineProvider } from '@mantine/core';
// . . . .
<body>
<MantineProvider>
// . . . . .
Dmitry commented
Omar Mashaal commented
Could you try adding external=react
to your mantine imports? Most react libraries require this when using with esm.sh