Skip to content
This repository has been archived by the owner on Mar 2, 2024. It is now read-only.

[bug] Source error when try with the latest branch Main #199

Closed
smpleader opened this issue May 12, 2022 · 5 comments
Closed

[bug] Source error when try with the latest branch Main #199

smpleader opened this issue May 12, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@smpleader
Copy link

smpleader commented May 12, 2022

I pulled repo today. And:

  • yarn install
  • yarn build:www, show error:

@tldraw/www:build:www: Failed to compile.
@tldraw/www:build:www:
@tldraw/www:build:www: ./pages/_app.tsx:56:8
@tldraw/www:build:www: Type error: 'Component' cannot be used as a JSX component.
@tldraw/www:build:www: Its element type 'ReactElement<any, any> | Component<{}, any, any>' is not a valid JSX element.
@tldraw/www:build:www: Type 'Component<{}, any, any>' is not assignable to type 'Element | ElementClass'.
@tldraw/www:build:www: Type 'Component<{}, any, any>' is not assignable to type 'ElementClass'.
@tldraw/www:build:www: The types returned by 'render()' are incompatible between these types.
@tldraw/www:build:www: Type 'React.ReactNode' is not assignable to type 'import("/Users/SourceCode/Node/tldraw/node_modules/@types/react-router/node_modules/@types/react/index").ReactNode'.
@tldraw/www:build:www: Type '{}' is not assignable to type 'ReactNode'.
@tldraw/www:build:www:
@tldraw/www:build:www: 54 | <title>tldraw</title>
@tldraw/www:build:www: 55 | </Head>
@tldraw/www:build:www: > 56 | <Component {...pageProps} />
@tldraw/www:build:www: | ^
@tldraw/www:build:www: 57 | </>
@tldraw/www:build:www: 58 | )
@tldraw/www:build:www: 59 | }

  • yarn start:www show error:

@tldraw/core:start: ‣ @tldraw/core: src/hooks/useZoomEvents.ts:129:9 - error TS2322: Type 'number' is not assignable to type 'Vector2 | ((state: PinchState & { event: WheelEvent | TouchEvent | PointerEvent | WebKitGestureEvent; }) => Vector2) | undefined'.
@tldraw/core:start:
@tldraw/core:start: 129 from: zoom,

  • yarn start show same error with @tldraw/core: src/hooks/useZoomEvents.ts:129:9

Could you please have a suggestion.
Thank you.

@smpleader smpleader added the bug Something isn't working label May 12, 2022
@steveruizok
Copy link
Contributor

I believe this is a bug in React's TypeScript types. Could you nuke node_modules and re-install?

@smpleader
Copy link
Author

smpleader commented May 17, 2022

Thank you Steve for your reply.
I tried git pull today , remove node_modules and try re-install
I run yarn build:www
I run yarn start:www
And site is available in http://localhost:55944
When I test the site, page is blank with a bug
Uncaught TypeError: Cannot read properties of null (reading 'useState')
Is there any step I missed ?

@judicaelandria
Copy link
Contributor

humm, you should remove node_modules and yarn.lock and then re-install

  • yarn build
  • yarn start:www

you should have access to

  • localhost:3000
  • and localhost:5420

@steveruizok
Copy link
Contributor

Closing, I believe I solved this in the most recent update (or maybe the types were updated correctly by React?).

@smpleader
Copy link
Author

I have tested again with new clone and it works.
Thank you steveruizok, judicaelandria

@TodePond TodePond transferred this issue from tldraw/tldraw May 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants