Nix-build error: "Cannot copy ./. to .: destination already exists!"

I have a pretty basic setup where my frontend is made with Vite.
Now, I want to introduce Nix for running CI commands like nix-shell --run "npm test"

When I try to build with nix-build, I receive the following error:

error: builder for '/nix/store/j2z762j11km1yx2p19xyghwjdjq84azz-frontend.drv' failed with exit code 1;
       last 5 log lines:
       > Running phase: unpackPhase
       > unpacking source archive ./.
       > Cannot copy ./. to .: destination already exists!
       > Did you specify two "srcs" with the same "name"?
       > do not know how to unpack source archive ./.

Here is my default.nix:

let
    nixpkgs = import (fetchTarball("https://github.com/NixOS/nixpkgs/archive/refs/tags/24.05.tar.gz")) {};
in
with nixpkgs;

stdenv.mkDerivation {
    name = "frontend";
    src = "./.";
    buildInputs = [
        nodejs_20
    ];
    installPhase = ''
        echo "===> 1/1 Installing packages"
        npm i
        echo "===> 1/1 Packages installed"
    '';
}

I don’t understand why it cannot copy… Can someone help me out?

Thanks in advance!

Solved.

My configuration file had a typo: src should not use ".