Skip to content

[Next.js] basePath should be / when using a custom URL #67

@TimPietrusky

Description

@TimPietrusky

When configuring a custom domain for a repository, the basePath for a Next.js app should not include the name of the repo as the root of the website is just /.

Steps to reproduce

  • Configure a custom URL for a repo in Settings > Pages > Custom Domain
  • Deploy the next-app using actions/configure-pages@v3
  • See that none of the resources (like CSS or JS) can be loaded as the basePath is set to reponame

Workaround

To still keep the "disable image optimisation"-option, I forked this action and removed the basePath config, but that is not optimal.

Suggestion

  • Make the basePath configurable and when nothing is configured, it's using the reponame, but a user could overwrite it with / if they want to
  • Update the comment in the provided workflow (nextjs.yml) to make sure that user know that this can be done (but I guess this is not the scope of this repo, pease let me know where this should be fixed)

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