Getting HTTP error 500 with empty Nuxt site

I’m trying to deploy a website made with Nuxt 3 to CF Pages, but I’m getting an error after visiting the site.

Steps to reproduce:

  1. Create the app with the following command:
    $ npm create cloudflare@latest my-nuxt-app -- --framework=nuxt
    
    Do you want to use git for version control? No
    Do you want to deploy your application? No
  2. Change the working directory:
    $ cd my-nuxt-app
    
  3. Build and deploy the app:
    $ npm run pages:deploy
    

After waiting for a few minutes, I opened the given URL and got a 500 This page is temporarily unavailable error.

Trying to access the site with cURL, I get a JS error:

{"url":"/","statusCode":500,"statusMessage":"","message":"Cannot read properties of undefined (reading 'startsWith')","stack":""}