microsoft / pxt

Microsoft MakeCode (PXT - Programming eXperience Toolkit)
https://makecode.com
MIT License
2.06k stars 568 forks source link

`npm run build` fails with Type Mismatch Errors #9620

Closed emoltz closed 11 months ago

emoltz commented 11 months ago

Describe the bug When trying to build the PXT repo, a typescript error occurs related to the @types/react package. The error indicates the following:

  Its instance type 'Provider<AnyAction>' is not a valid JSX element.
    The types returned by 'render()' are incompatible between these types.
      Type 'React.ReactNode' is not assignable to type 'import("/Users/ethanshafranmoltz/node_modules/@types/react/ts5.0/index").ReactNode'.
        Type '{}' is not assignable to type 'ReactNode'.
    20 | ReactDOM.render(
    21 |     <React.StrictMode>
  > 22 |         <Provider store={store}>
       |          ^^^^^^^^
    23 |             <App />
    24 |         </Provider>
    25 |     </React.StrictMode>,

To Reproduce clone this repo run npm i run npm run build It fails with the above error.

Desktop OS: MacOS M1 Node.js version: 18.17.0 TypeScript Version: 4.4.3 @types/react version: 17.0.5

Additional Info I've tried for the last few days to resolve this issue -- chatGPT, Google, StackOverflow, etc. So far, no luck. I am eager to contribute to this project -- let me know how I can get this going on my end!

emoltz commented 11 months ago

Fixed: running this on a folder located within an iCloud folder causes the issue.