-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Next.js] basePath should be / when using a custom URL #67
Comments
Thanks for the report, @TimPietrusky! Do you happen to have a public repo available where you're running into this issue? 🤔 We haven't seen this behavior ourselves as far as I know, but definitely open to expanding our internal end-to-end tests if we're missing something. 👍🏻
The Next.js starter workflow template that GitHub suggests can be found in the |
One debugging step that would also help is to check what Pages site URL is being detected by the Action. This would help narrow down if the issue is in the values returned by the Pages REST API, a bug in our injection code, or some incompatibility between your Next.js config and our injection code. To debug, update your Actions workflow with a few changes like the following: # Find your existing step for this, then add an `id` property
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
with:
static_site_generator: next
- name: Dump Pages configuration
run: |
echo PAGES_BASE_URL: ${{ steps.pages.outputs.base_url }}
echo PAGES_ORIGIN: ${{ steps.pages.outputs.origin }}
echo PAGES_HOST: ${{ steps.pages.outputs.host }}
echo PAGES_BASE_PATH: ${{ steps.pages.outputs.base_path }} Although I'd like to fix whatever issue you're running into, it's probably also worth mentioning that you could probably use the aforementioned |
ok |
@JamesMGreene thanks for your message! The public repo where I was running into this is: https://github.com/iieinander/iieinander.band Is there anything else that you need? |
@TimPietrusky What I'm seeing in your Actions logs would suggest that the https://github.com/iieinander/iieinander.band/actions/runs/4173980364/jobs/7226978361#step:5:58 Extra line breaks added for legibility:
|
@JamesMGreene yes, this is true, but only because I'm using my fork. When I used the original action, the https://github.com/iieinander/iieinander.band/actions/runs/4166191535/jobs/7210202546#step:5:58
In my fork TimPietrusky@f294021, I commented out the |
Noting that we ran into this same issue at https://github.com/CodeWithAloha/CWAWebsite, more info at CodeWithAloha/website#51 |
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
Settings > Pages > Custom Domain
actions/configure-pages@v3
basePath
is set toreponame
Workaround
To still keep the "disable image optimisation"-option, I forked this action and removed the
basePath
config, but that is not optimal.Suggestion
basePath
configurable and when nothing is configured, it's using thereponame
, but a user could overwrite it with/
if they want tonextjs.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)The text was updated successfully, but these errors were encountered: