`yarn create react-app` with @chakra-ui/typescript failing to compile
See original GitHub issueBug report
When trying to start a project project from the start with the help of create react-app
, the unmodified, fresh project is failing to compile.
To reproduce
Simply type yarn create react-app my-app --template @chakra-ui/typescript
and then yarn start
into the new project.
System information
- Version of @chakra-ui/core: 1.0.0-rc.3
- Version of Node.js: v12.14.0
Getting this message:
TypeScript error in /[…]/my-app/src/App.tsx(23,9):
No overload matches this call.
Overload 1 of 2, '(props: Pick<GridProps, "row" | "ref" | "area" | "p" | "slot" | "style" | "title" | "aria-label" | "key" | "sx" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | ... 491 more ... | "templateAreas"> & Pick<...> & { ...; } & Pick<...>): ReactElement<...> | null', gave the following error.
Type '{ children: Element[]; minH: string; p: number; direction: string; align: string; justify: string; }' is not assignable to type 'IntrinsicAttributes & Pick<GridProps, "row" | "ref" | "area" | "p" | "slot" | "style" | "title" | "aria-label" | "key" | "sx" | "defaultChecked" | ... 493 more ... | "templateAreas"> & Pick<...> & { ...; } & Pick<...>'.
Property 'direction' does not exist on type 'IntrinsicAttributes & Pick<GridProps, "row" | "ref" | "area" | "p" | "slot" | "style" | "title" | "aria-label" | "key" | "sx" | "defaultChecked" | ... 493 more ... | "templateAreas"> & Pick<...> & { ...; } & Pick<...>'.
Overload 2 of 2, '(props: Pick<GridProps, "row" | "ref" | "area" | "p" | "slot" | "style" | "title" | "aria-label" | "key" | "sx" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | ... 491 more ... | "templateAreas"> & Pick<...>): ReactElement<...> | null', gave the following error.
Type '{ children: Element[]; minH: string; p: number; direction: string; align: string; justify: string; }' is not assignable to type 'IntrinsicAttributes & Pick<GridProps, "row" | "ref" | "area" | "p" | "slot" | "style" | "title" | "aria-label" | "key" | "sx" | "defaultChecked" | ... 493 more ... | "templateAreas"> & Pick<...>'.
Property 'direction' does not exist on type 'IntrinsicAttributes & Pick<GridProps, "row" | "ref" | "area" | "p" | "slot" | "style" | "title" | "aria-label" | "key" | "sx" | "defaultChecked" | ... 493 more ... | "templateAreas"> & Pick<...>'. TS2769
21 | minH="100vh"
22 | p={3}
> 23 | direction="column"
| ^
24 | align="center"
25 | justify="center"
26 | >
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Create React App - Chakra UI
A guide for installing Chakra UI with create-react-app projects. ... yarn create react-app my-app --template @chakra-ui/typescript.
Read more >Error: Can't resolve 'fs' in '/home/bassam/throwaway/chakra-ts ...
Now when I do yarn build it fails with the following: Creating an optimized production build... Failed to compile. Module not found: Error: ......
Read more >Build a component library with React and TypeScript
Learn to create a component library with React and TypeScript in this in-depth tutorial that includes testing and deploying to npm.
Read more >how add typescript support to an existed project? : r/react
After renaming any files, you'll need to restart your project. As long as you've installed those NPM / Yarn packages, the React build...
Read more >Introduction to Micro Frontends with Module Federation, React ...
npx create-react-app container --template typescript ... serve ts-loader webpack webpack-cli webpack-dev-server @chakra-ui/react ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No, sadly its a limitation on CRAs side how templates are retrieved. It will be automatically fixed once v1 is out. See #2303 too.
Hey there, I had the same problem after installing chakra-ui using the cra typescript template (
npx create-react-app chakra --template @chakra-ui/typescript
). In the package.json the versions are as following:Shouldn’t it be fixed? 🤨