Skip to content

Errors in unchanged example source code -- reactflow-nextjs #6

Open
@chris-braidwell

Description

@chris-braidwell
  1. I downloaded this repo
  2. cd reactflow-nextjs-app-router
  3. yarn install
  4. view code in VS Code:

Error 1

❯ npx tsc

src/pages/_app.tsx:7:11 - error TS2786: 'Component' cannot be used as a JSX component.
  Its element type 'ReactElement<any, any> | Component<any, any, any> | null' is not a valid JSX element.
    Type 'Component<any, any, any>' is not assignable to type 'Element | ElementClass | null'.
      Type 'Component<any, any, any>' is not assignable to type 'ElementClass'.
        The types returned by 'render()' are incompatible between these types.
          Type 'React.ReactNode' is not assignable to type 'import("/Users/chris/projects/2-react-flow-example-apps/reactflow-nextjs/node_modules/@types/react-dom/node_modules/@types/react/ts5.0/index").ReactNode'.
            Type 'ReactElement<any, string | JSXElementConstructor<any>>' is not assignable to type 'ReactNode'.
              Property 'children' is missing in type 'ReactElement<any, string | JSXElementConstructor<any>>' but required in type 'ReactPortal'.

7   return <Component {...pageProps} />;
            ~~~~~~~~~

  node_modules/@types/react-dom/node_modules/@types/react/ts5.0/index.d.ts:378:9
    378         children: ReactNode;
                ~~~~~~~~
    'children' is declared here.

Found 1 error in src/pages/_app.tsx:7

Error 1 prevents the app from being built. It can be run via yarn run dev, but yarn run build fails.

May matter -- I'm running Node v21.7.1. Note the repo doesn't specify what Node version to use.

See related #5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions