Skip to content
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

Fix: subdirectory deployment #2205

Merged
merged 1 commit into from
Oct 18, 2023
Merged

Fix: subdirectory deployment #2205

merged 1 commit into from
Oct 18, 2023

Conversation

alfchao
Copy link
Contributor

@alfchao alfchao commented Oct 18, 2023

Proposed change

Closes #2128 #539

Type of change

  • New service widget
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation only
  • Other (please explain)

Checklist:

  • If adding a service widget or a change that requires it, I have added corresponding documentation changes.
  • If adding a new widget I have reviewed the guidelines.
  • If applicable, I have checked that all tests pass with e.g. pnpm lint.
  • If applicable, I have tested my code for new features & regressions on both mobile & desktop devices, using the latest version of major browsers.

tips:
next.config.js. add assetPrefix: ".",
others. mod /api/xxx to api/xxx.
thanks for @benphelps @shamoon guides. #2194

I am learning to contribute code & PR. If there are any mistakes, I kindly request guidance from everyone.

@shamoon
Copy link
Collaborator

shamoon commented Oct 18, 2023

I have no idea why #2194 was merged, its an empty PR and was blocked, huh?

Edit: actually even weirder the commit from that PR is for a completely different PR. Weird.

Anyway, thanks for re-creating

Copy link
Collaborator

@shamoon shamoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general this seems fine to me. I havent tried setting up a subdirectory deployment however, because I find them to be a bit of a pain.

In general seems safe, so OK by me, but curious if @benphelps has any other thoughts

next.config.js Show resolved Hide resolved
@shamoon
Copy link
Collaborator

shamoon commented Oct 18, 2023

you might want to disable the pull bot on your fork, seems to break your PRs. Or you also might avoid this by making PRs from a branch not main, but I’m not sure

@benphelps
Copy link
Member

benphelps commented Oct 18, 2023

In general this seems fine to me. I havent tried setting up a subdirectory deployment however, because I find them to be a bit of a pain.

In general seems safe, so OK by me, but curious if @benphelps has any other thoughts

I'm sure this will have some adverse effects for a handful of users, but is worth the trouble to get this recurring issue taken care of. Looks fine. Looked fine, haha.

@alfchao
Copy link
Contributor Author

alfchao commented Oct 18, 2023

you might want to disable the pull bot on your fork, seems to break your PRs. Or you also might avoid this by making PRs from a branch not main, but I’m not sure

sorry. i see. I will disable the pull bot.

@alfchao
Copy link
Contributor Author

alfchao commented Oct 18, 2023

In general this seems fine to me. I havent tried setting up a subdirectory deployment however, because I find them to be a bit of a pain.
In general seems safe, so OK by me, but curious if @benphelps has any other thoughts

I'm sure this will have some adverse effects for a handful of users, but is worth the trouble to get this recurring issue taken care of. Looks fine. Looked fine, haha.

I see some problems in issue, I try to solve them, and it seems no problems at present. Thanks for your guidance. ^v^.

@shamoon shamoon merged commit b8eda91 into gethomepage:main Oct 18, 2023
3 checks passed
@shamoon
Copy link
Collaborator

shamoon commented Oct 18, 2023

Hmm, this might have broken the font, now getting a 404 and loading https://**/_next/static/css/_next/static/media/Manrope.63012343.woff2

I'll try to investigate

shamoon added a commit that referenced this pull request Oct 18, 2023
@shamoon
Copy link
Collaborator

shamoon commented Oct 18, 2023

@alfred-nice unfortunately we're going to revert this change for now, it does seem to break the font and the fix is not obvious, sort of a catch-22 with importing the font files into the css and a relative URL.

Of course if you can solve it we'd be happy to merge a subsequent PR.

Thanks for your effort.

@alfchao
Copy link
Contributor Author

alfchao commented Oct 26, 2023

@alfred-nice unfortunately we're going to revert this change for now, it does seem to break the font and the fix is not obvious, sort of a catch-22 with importing the font files into the css and a relative URL.

Of course if you can solve it we'd be happy to merge a subsequent PR.

Thanks for your effort.

When subdirectory deployment, the correct path should be /homepage/_next/static/media/Manrope.63012343.woff2 (200 good), not /homepage/_next/static/css/_next/static/media/Manrope.63012343.woff2 (404 bad).

I'm not sure where this font was imported from, and I don't have much knowledge about Next.js. I would greatly appreciate it if someone could provide me with guidance on this matter.

Thanks!

@waltlawsmacd
Copy link

waltlawsmacd commented Oct 31, 2023

@alfchao I believe the font is imported in this file - I also don't know much about Next.js, but I'm guessing the relative path is what's causing the broken link

Copy link
Contributor

github-actions bot commented Feb 5, 2024

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] base and startUrl invalid
4 participants