-
Notifications
You must be signed in to change notification settings - Fork 6
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
Generated page links are incorrect #13
Comments
@kireerik This is the expected behavior. It sounds like you’re requesting that this be made configurable to accommodate your hosting setup? What is the error you’re encountering? Is your web server unable to serve these assets? |
Yes, I guess if someone wants to use the output locally then this can be a good default. I serve (static HTML) pages as usual. On |
@kireerik Are you running into an issue? I suspect this works as is for your use case: |
Yes, I think the pages are not |
@kireerik what are you using to serve your web pages? |
Firebase Hosting |
@kireerik if you make a web request to one of your pages, eg |
@kireerik if you set build.format to I’ll think on whether I’ll have this plugin set the that option, or inspect the config value and configure the service worker generation accordingly. |
No, I don't get a response. Currently it is redirecting, but I might change it so that it would return a There is no such |
@kireerik sorry yes I mean |
Yes I am already using |
@kireerik Is there a specific issue you're encountering, other than the generated service worker not looking the way you expected? Is your concern that your pages are not being cached, and you're unsure of how to test that? |
Yes, it is not preloaded, because it should point to the correct path (not including |
@kireerik is the site public? Can you share the link? |
@kireerik It doesn’t look like you have a service worker deployed to that domain. Could you deploy the service worker? |
Yes, I didn't introduce it because of this issue. |
@kireerik I think this is a misunderstanding, as opposed to something that requires a change to this library. If you deploy a version of your site with the service worker enabled, I'm happy to help you debug. Alternative, take a look at my blog, https://www.tatethurston.com/, which uses this library. Note that the pages are served by the service worker, even though they are requested without the |
Maybe with your blog the reason for that is because you make them available with the |
The current settings match the defaults for most web servers. Under the hood, this library is a light weight wrapper around workbox-build. Workbox build generates the precache urls from the filesystem. If you find a way to achieve what you want using workbox build I’m happy to consider an addition to this library. But the best path forward to achieve the constraints you’ve outlined is to have Astro generate pages without an html extension, or add a processing step that removes them. I’m unsure if this functionality already exists. |
@kireerik My blog is currently hosted on AWS Amplify. I pushed it to Cloudflare pages, which includes redirects to extensionless pages out of the box: https://blog-5hp.pages.dev. Note that eg
And the service worker works as expected. |
example:
generated:
index.html
page/index.html
expected:
/
page
The text was updated successfully, but these errors were encountered: