Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to compile /examples/material-ui-nextjs-pages-router-ts #37500

Closed
itsazzad opened this issue Jun 5, 2023 · 2 comments
Closed

Failed to compile /examples/material-ui-nextjs-pages-router-ts #37500

itsazzad opened this issue Jun 5, 2023 · 2 comments
Labels
bug 🐛 Something doesn't work examples Relating to /examples nextjs typescript

Comments

@itsazzad
Copy link

itsazzad commented Jun 5, 2023

yarn build

  • info Linting and checking validity of types ..Failed to compile.

./pages/_app.tsx:20:6
Type error: 'CacheProvider' cannot be used as a JSX component.
Its return type 'ReactNode' is not a valid JSX element.
Type 'undefined' is not assignable to type 'Element | null'.

  18 |   const { Component, emotionCache = clientSideEmotionCache, pageProps } = props;
  19 |   return (
> 20 |     <CacheProvider value={emotionCache}>
     |      ^
  21 |       <Head>
  22 |         <meta name="viewport" content="initial-scale=1, width=device-width" />
  23 |       </Head>
@brijeshb42 brijeshb42 added examples Relating to /examples typescript labels Jun 5, 2023
@brijeshb42
Copy link
Contributor

brijeshb42 commented Jun 5, 2023

Seems to be related to the changes in the latest version of @types/react. I'll check if this can be fixed in the example or do we need to wait for upstream fixes in emotion. Here's a temporary workaround suggested that can be added so that next build command works without any failure.

@oliviertassinari
Copy link
Member

oliviertassinari commented Jan 17, 2024

emotion-js/emotion#3049 was fixed. I can't reproduce in the latest version.

@oliviertassinari oliviertassinari added nextjs bug 🐛 Something doesn't work labels Jan 17, 2024
@oliviertassinari oliviertassinari changed the title Failed to compile /examples/material-next-ts Failed to compile /examples/material-ui-nextjs-pages-router-ts Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work examples Relating to /examples nextjs typescript
Projects
None yet
Development

No branches or pull requests

3 participants