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

Abysmally slow nuxt dev on NixOS #39

Open
auctumnus opened this issue Sep 17, 2024 · 2 comments
Open

Abysmally slow nuxt dev on NixOS #39

auctumnus opened this issue Sep 17, 2024 · 2 comments

Comments

@auctumnus
Copy link

Hi!

I tried to set up Prisma with Nuxt, but it appears to cause nuxt dev to be abysmally slow, even if it's not actually enabled as a module.

Fresh Nuxt project (808ms):

nuxt dev server takes 808ms to start

With "@prisma/nuxt": "^0.0.35" in dependencies and "@prisma/client": "^5.19.1", "prisma": "^5.19.1" in devDependencies (100203 ms, or nearly 2 minutes):

nuxt dev server takes nearly 2 minutes to start

This is the flake.nix I'm using in both:

{
  inputs.pkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
  inputs.prisma-utils.url = "github:VanCoding/nix-prisma-utils";

  outputs =
    { pkgs, prisma-utils, ... }:
    let
      nixpkgs = import pkgs { system = "x86_64-linux"; };
      prisma =
        (prisma-utils.lib.prisma-factory {
          inherit nixpkgs;
          prisma-fmt-hash = "sha256-Lj0V8E9a+q6+PvCF2ARRs34n1Ls3vySVmtN1rxfltRg=";
          query-engine-hash = "sha256-1BwohGMohcS0rQkrbD+4ne63NOtlZnxLfYUEMrnbglg=";
          libquery-engine-hash = "sha256-WWE2c5Xjw+7wbeGcdX6UU8YzPeT1vZQxye/Mh8XFsCA=";
          schema-engine-hash = "sha256-y5zt3jlaIBoxNHcDitOkMfLd/5doCadVmUiE4bAM/MA=";
        }).fromNpmLock
          ./package-lock.json;
    in
    {
      devShells.x86_64-linux.default = nixpkgs.mkShell {
        buildInputs = with nixpkgs; [
          nodejs_22
          nodePackages_latest.prisma
          openssl_3_3
        ];
        shellHook = prisma.shellHook;
      };
    };
}

Is there anything else I can do to help debug this issue?

@Dzyanino
Copy link

Dzyanino commented Oct 9, 2024

Hey there

I also got the same issue but using Archlinux
It launched fine at first but after some time (I can't understand how) it started to take like 294893.35ms to setup
Here is the output

> nuxt dev

Nuxt 3.13.2 with Nitro 2.9.7                                                                                                                                                    2:17:06 PM
                                                                                                                                                                                2:17:08 PM
  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose

ℹ Using default Tailwind CSS file                                                                                                                             nuxt:tailwindcss 2:17:14 PM
✔ Prisma CLI is already installed.                                                                                                                                             2:18:30 PM
✔ Prisma schema file exists.                                                                                                                                                   2:18:30 PM
✔ Database migrations folder exists.                                                                                                                                           2:18:30 PM
                                                                                                                                                                                2:18:30 PM
Not migrating the database.
Generating Prisma client...

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma

✔ Generated Prisma Client (v5.20.0) to ./node_modules/@prisma/client in 135ms

✔ Do you want to view and edit your data by installing Prisma Studio in Nuxt DevTools? … yes
Starting Prisma Studio...                                                                                                                                                       2:21:30 PM

✔ Prisma Studio installed.                                                                                                                                                     2:21:30 PM
After clicking Get Started in Nuxt DevTools, click on the three dots (︙) in the lower left-hand side to reveal additional tabs.
Locate the Prisma logo to open Prisma Studio.

 WARN  Slow module @prisma/nuxt took 294893.35ms to setup.                                                                                                                      2:21:30 PM

  ➜ DevTools: press Shift + Alt + D in the browser (v1.4.2)

@ankur-arch
Copy link
Contributor

ankur-arch commented Oct 18, 2024

Hey there @auctumnus , can you set the export variable and see which step is taking up most of your time? Also the same @Dzyanino.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants