fix(feed-directory): bundle catalog client script in Astro build - #1242
Merged
Conversation
The feed directory referenced ./feed-directory.js as a raw src URL, which 404'd in production and prevented GET /api/v1/configs from ever running. Use an inline Astro script import so Vite emits a hashed /_astro/ bundle.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
src/components/FeedDirectory.astroloadsfeed-directory.jsvia an inline Astro<script>import instead of<script src="./feed-directory.js">./_astro/FeedDirectory.astro_astro_type_script_index_0_lang.*.js, which includes the catalog client andGET /api/v1/configsfetch.Why
The feed directory shipped a relative
./feed-directory.jsURL in the built HTML. On GitHub Pages that resolves to/feed-directory/feed-directory.js, which 404s, so the client never ran and the instance catalog API was never requested.Risk
/feed-directory/requests{instance}/api/v1/configsin the network panel.Review map
Review map: whole PR is small — start at
src/components/FeedDirectory.astro.Validation
make build(exit 0)dist/feed-directory/index.htmlreferences/_astro/FeedDirectory.astro_astro_type_script_index_0_lang.*.js, not./feed-directory.js