Flake.nix for create t3-app and nextjs14

Hey there, so I wanted to upgrade my t3-app from next13 to next14. I followed the usual upgrade procedure and then wanted to start my dev server with yarn dev - however, I got the error that:
class NextRequest extends Request {
^

ReferenceError: Request is not defined
class NextRequest extends Request {
^

ReferenceError: Request is not defined
- found this thread https://github.com/vercel/next.js/issues/57214, but after trying all kinds of different node versions, yarn versions and even bun - i still get this error. in the github issue, they talk about node 16, which i have not installed at all. here i my flake.nix for the dev shell
{
description = "T3 Stack with Monero Flake";

inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; };

outputs = { self, nixpkgs, ... }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.x86_64-linux.default = with pkgs;
mkShell {

packages = [
bun
nodePackages.prettier
nodePackages.eslint
nodePackages.typescript

nodePackages.prisma
prisma-engines
monero-cli
openssl

];
nativeBuildInputs = [

bashInteractive

];
shellHook = ''
export BROWSER=none
export NODE_OPTIONS="--no-experimental-fetch"
export PRISMA_QUERY_ENGINE_BINARY="${prisma-engines}/bin/query-engine"
export PRISMA_QUERY_ENGINE_LIBRARY="${prisma-engines}/lib/libquery_engine.node"
export PRISMA_INTROSPECTION_ENGINE_BINARY="${prisma-engines}/bin/introspection-engine"
export PRISMA_FMT_BINARY="${prisma-engines}/bin/prisma-fmt"
export PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING="true"
node -v
'';
};
};
}
{
description = "T3 Stack with Monero Flake";

inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; };

outputs = { self, nixpkgs, ... }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.x86_64-linux.default = with pkgs;
mkShell {

packages = [
bun
nodePackages.prettier
nodePackages.eslint
nodePackages.typescript

nodePackages.prisma
prisma-engines
monero-cli
openssl

];
nativeBuildInputs = [

bashInteractive

];
shellHook = ''
export BROWSER=none
export NODE_OPTIONS="--no-experimental-fetch"
export PRISMA_QUERY_ENGINE_BINARY="${prisma-engines}/bin/query-engine"
export PRISMA_QUERY_ENGINE_LIBRARY="${prisma-engines}/lib/libquery_engine.node"
export PRISMA_INTROSPECTION_ENGINE_BINARY="${prisma-engines}/bin/introspection-engine"
export PRISMA_FMT_BINARY="${prisma-engines}/bin/prisma-fmt"
export PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING="true"
node -v
'';
};
};
}
is anybody else using nix for a devshell? and has a working flake or shell.nix for nextjs14? When i downgrade to next13 in package json it all works... 😦
GitHub
Issues · vercel/next.js
The React Framework. Contribute to vercel/next.js development by creating an account on GitHub.
2 Replies
Lopen
Lopen•13mo ago
I haven't tried next 14 but i use devenv with direnv on next 13 and it works fine
AlexAnarcho
AlexAnarchoOP•13mo ago
Yes, nextjs13 works fine for me too
Want results from more Discord servers?
Add your server