In Razor Pages, the JavaScript files belong in the wwwroot folder. The src path is relative to the wwwroot. See the Static File Service.
You can also, use the @Section scripts {} to add JavaScript to a Razor Page as illustrated in the official documentation.