Skip to content

baseUrl not used correctly anymore #756

@zendre4

Description

@zendre4

Since version 0.12.0 with nuxt > 4.2.0 the baseUrl was not used correctly.

When I set a baseUrl like that :

{
 app: {
    baseURL: "/page/",
  },
  runtimeConfig: {
    app: {
      baseURL: "/page/"
    }
  }
}

The url omit /page
Image

When I set the assets prefix :

 fonts: {
    assets: {
      // for fix bad url with @nuxt/fonts
      prefix: "/page/_fonts/",
    },
  },

I have :

Image

And the good url to access the fonts is /page/page/_fonts/...

With the previous version, I didn't need to set anything up and everything worked...

For the moment I fix it with a custom route who redirect to the /page/page/fonts/

//for bugfix bad url with nuxt fonts
export default defineEventHandler(async (event) => {
  const fontPath = getRouterParam(event, "_");

  if (!fontPath) {
    throw createError({
      statusCode: 404,
      statusMessage: "Not Found",
    });
  }
  await sendRedirect(event, `/page/page/_fonts/${fontPath}`, 301);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions