blitz-js / legacy-framework

MIT License
2 stars 2 forks source link

Newly initialized project completely broken #134

Closed Kombustor closed 2 years ago

Kombustor commented 2 years ago

What is the problem?

When creating a new project using blitz new it fails to build.

Paste all your error logs here:

╰─$ blitz new test-blitz
✔ You have the latest Blitz version
✔ Pick a new project's language · TypeScript
✔ Pick your new app template · full
✔ Install dependencies? · yarn
✔ Pick a form library (you can switch to something else later if you want) · React Hook Form
....
<trimmed>
....
╰─$ cd test-blitz
╰─$ blitz build
Loaded env from test-blitz/.env.local
Loaded env from test-blitz/.env
info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
info  - Generating route manifest  
Failed to compile.

./app/auth/pages/forgot-password.tsx:46:43
Type error: 'Layout' cannot be used as a JSX component.
  Its element type 'ReactElement<any, any> | Component<{ title?: string | undefined; }, any, any> | null' is not a valid JSX element.
    Type 'Component<{ title?: string | undefined; }, any, any>' is not assignable to type 'Element | ElementClass | null'.
      Type 'Component<{ title?: string | undefined; }, 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("/media/DataSSD/Projekte/misc/test-blitz/node_modules/@testing-library/react-hooks/node_modules/@types/react/index").ReactNode'.
            Type '{}' is not assignable to type 'ReactNode'.
              Type '{}' is missing the following properties from type 'ReactPortal': key, children, type, props

  44 | 
  45 | ForgotPasswordPage.redirectAuthenticatedTo = "/"
> 46 | ForgotPasswordPage.getLayout = (page) => <Layout title="Forgot Your Password?">{page}</Layout>
     |                                           ^
  47 | 
  48 | export default ForgotPasswordPage
  49 | 

Paste all relevant code snippets here:

-

What are detailed steps to reproduce this?

  1. Create a new project with blitz new <name>
  2. Run blitz build

Run blitz -v and paste the output here:

Linux 5.4 | linux-x64 | Node: v16.14.2

blitz: 0.45.3 (global)
blitz: 0.45.3 (local)

  Package manager: yarn 
  System:
    OS: Linux 5.4
    CPU: (16) x64 AMD Redacted
    Memory: 8.93 GB / 15.65 GB
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    Yarn: 1.22.17 - /usr/bin/yarn
    npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
    Watchman: Not Found
  npmPackages:
    @prisma/client: 3.12.0 => 3.12.0 
    blitz: 0.45.3 => 0.45.3 
    prisma: 3.12.0 => 3.12.0 
    react: 18.0.0-beta-149b420f6-20211119 => 18.0.0-beta-149b420f6-20211119 
    react-dom: 18.0.0-alpha-5ca4b0433-20211020 => 18.0.0-alpha-5ca4b0433-20211020 
    typescript: ~4.5 => 4.5.5 

Please include below any other applicable logs and screenshots that show your problem:

Why is blitz using alpha/beta versions of react/react-dom 18? image