NuxtN
Nuxt12mo ago
Koen

Nuxt Generate with BaseUrl

When I run nuxt generate and then start it with NUXT_APP_BASE_URL=/dash/ npx serve .output/public all the requests still go to http://127.0.0.1:3000/... instead of http://127.0.0.1:3000/dash/....

I have the same issue when using static images, when i use the following code:
<div
  class="float-right h-[150px] w-[150px] md:col-span-4 md:float-none md:h-[300px] md:w-[300px]"
>
  <NuxtImg
    src="/img/profile.jpg"
    alt="Profile picture"
    class="h-full w-full rounded-lg object-cover shadow-lg"
  />
</div>

it doesn't work with the baseurl.
it seems that the baseurl doesn't get applied while static starting and when I try to generate it with the baseurl variable set i get errors about images not found. (see attachment)
Was this page helpful?