question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v5.1.0 won't compile in Create React App TypeScript

See original GitHub issue

Thanks for using react-select!

I upgraded to v5.1.0 from v4.3.1 and I am seeing this compiler error. I am using TypeScript v4.4.3 with Create React App v4.0.3.

Are you reporting a bug or runtime error?

Failed to compile.

~/app/frontend/node_modules/react-select/src/components/containers.tsx
TypeScript error in ~/app/frontend/node_modules/react-select/src/components/containers.tsx(51,7):
Type '{ children: ReactNode; ref?: LegacyRef<HTMLDivElement> | undefined; key?: Key | null | undefined; defaultChecked?: boolean | undefined; ... 252 more ...; css: CSSObjectWithLabel; }' is not assignable to type 'DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>'.
  Property 'css' does not exist on type 'DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>'.  TS2322

    49 |   return (
    50 |     <div
  > 51 |       css={getStyles('container', props)}
       |       ^
    52 |       className={cx(
    53 |         {
    54 |           '--is-disabled': isDisabled,

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
okbytescommented, Oct 8, 2021

I found the error. A sneaky /src import among the normal ones. Apologies for the false alamr. Now my app is breaking as expected from all the new typings and such.

src/common/SchemaForm/typeaheadParam.tsx:
  3  import {Controller, useFormContext} from "react-hook-form"
  4: import {OptionsType, ValueType} from "react-select"
  5: import AsyncSelect from "react-select/async"
  6: import AsyncCreatableSelect from "react-select/async-creatable"
  7: import {CreatableProps} from "react-select/src/Creatable"
1reaction
okbytescommented, Oct 8, 2021

I will try.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when using new 'react-jsx' TypeScript transform #10144
To fix this, while viewing a TS file, bring up the command pallet (cmd+shift+p) and type "select typescript version", select the option and...
Read more >
create-react-app dependency version issues with React 18
Go back to your root folder and run npx create-react-app my-app (your app name) --template file:PATH_TO_YOUR_CUSTOM_TEMPLATE.
Read more >
Troubleshooting - Create React App
If this doesn't happen, try one of the following workarounds: Check that your file is imported by your entrypoint. TypeScript will show ...
Read more >
What Does Create-React-App Actually Do? | by Andrew Mc
It checks if TypeScript is a dependency after it does this. Next it begins adding to the json. First is the scripts. These...
Read more >
create-react-app | Yarn - Package Manager
Create React apps with no build configuration. ... Create React App 5.0.1 is a maintenance release that improves compatibility with React 18.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found