Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blitz new creates project with failing blitz build and pnpm test commands #4128

Closed
Warchant opened this issue Apr 16, 2023 · 3 comments
Closed
Labels
kind/bug Something isn't working status/done

Comments

@Warchant
Copy link

What is the problem?

I am running blitz new test, with options:

  1. Typescript
  2. Full (recommended)
  3. pnpm
  4. React Final Form (recommended)

Then:

cd test
blitz dev

Then I open localhost:3000 and I see the page, so everything works.

Now, I open new terminal (not closing the server) and trying to run tests:

$ pnpm test

And I see that prisma cannot be found:
image

But, prisma exists in dependencies section of package.json, and there's also globally installed prisma.

So that's first issue.

Now, in the same folder try to run blitz build

Paste all your error logs here:

$ blitz build
Loaded env from C:\tools\test\.env.local
Loaded env from C:\tools\test\.env
✔ Next.js was successfully patched with a React Suspense fix
✔ Routes manifest was successfully generated
info  - Linting and checking validity of types ...Failed to compile.

./vitest.config.ts:1:31
Type error: Cannot find module '@next/env' or its corresponding type declarations.

> 1 | import { loadEnvConfig } from "@next/env"
    |                               ^
  2 | import { defineConfig } from "vitest/config"
  3 |
  4 | import react from "@vitejs/plugin-react"

Paste all relevant code snippets here:

See above.

What are detailed steps to reproduce this?

See above.

Run blitz -v and paste the output here:

$ blitz -v 
Blitz version: 2.0.0-beta.26 (global)
Blitz version: 2.0.0-beta.26 (local)
Windows 11 | win32-x64 | Node: v19.2.0


 Package manager: pnpm

  System:
    OS: Windows 10 10.0.22621
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
    Memory: 2.63 GB / 15.71 GB
  Binaries:
    Node: 19.2.0 - ~\scoop\apps\nvm\current\nodejs\nodejs\node.EXE
    Yarn: Not Found
    npm: 9.1.2 - ~\scoop\apps\nvm\current\nodejs\nodejs\npm.CMD
  npmPackages:
    @blitzjs/auth: 2.0.0-beta.26 => 2.0.0-beta.26
    @blitzjs/next: 2.0.0-beta.26 => 2.0.0-beta.26
    @blitzjs/rpc: 2.0.0-beta.26 => 2.0.0-beta.26
    @prisma/client: 4.6.1 => 4.6.1
    blitz: 2.0.0-beta.26 => 2.0.0-beta.26
    next: ^13.3.0 => 13.3.0
    prisma: 4.6.1 => 4.6.1
    react: 18.2.0 => 18.2.0
    react-dom: 18.2.0 => 18.2.0
    typescript: ^4.8.4 => 4.9.5

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

No response

@Warchant Warchant added kind/bug Something isn't working status/triage labels Apr 16, 2023
@siddhsuresh
Copy link
Member

siddhsuresh commented May 11, 2023

Hey @Warchant, thanks for the issue. I will check this and include this issue while revamping the generated templates to the latest conventions.

@tartane
Copy link

tartane commented May 28, 2024

Any update on this? I am having this exact issue as of today.

@tartane
Copy link

tartane commented May 28, 2024

@Warchant did you ever find what is causing it? still relevant as of today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working status/done
Projects
Status: Done
Development

No branches or pull requests

5 participants