False positive prefetch external error when deployed to GitHub pages
See original GitHub issueDescribe the bug
Not quite sure what’s going wrong and if this is really a bug or misconfiguration on my part.
Trying to deploy this app to GitHub pages at https://janosh.github.io/periodic-table, all internal links log console errors:
Uncaught (in promise) Error: Attempted to prefetch a URL that does not belong to this app: https://janosh.github.io/periodic-table/polonium
The error is raised here:
and might be due to URLs incorrectly classified as external here (hard to say with minified stack trace in prod and can’t reproduce in dev)
data-sveltekit-prefetch is set globally on the body.
Reproduction
Doesn’t repro on StackBlitz as I think it’s related to serving the app on a non-root URL with a <base> tag as suggested in #7733.
Logs
No response
System Info
System:
OS: macOS 13.0
CPU: (10) arm64 Apple M1 Pro
Memory: 88.06 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.9.0 - /opt/homebrew/bin/node
npm: 8.19.1 - /opt/homebrew/bin/npm
Browsers:
Brave Browser: 107.1.45.127
Chrome: 107.0.5304.110
Safari: 16.1
npmPackages:
@sveltejs/adapter-static: 1.0.0-next.48 => 1.0.0-next.48
@sveltejs/kit: 1.0.0-next.553 => 1.0.0-next.553
svelte: ^3.53.1 => 3.53.1
vite: ^3.2.4 => 3.2.4
Severity
annoyance
Additional Information
No response
Issue Analytics
- State:
- Created 10 months ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Build errors during deployment to GitHub Pages · Issue #209
I am failed to deploy the ai-folio theme in my personal repository. Even I don't find any fruitful reason why it is happening....
Read more >Failure deployed on Github Pages · Discussion #23609
I mean, if I try to add something to the repository on Gihub Pages, some changes to my website, Github Pages doesn't update...
Read more >About Jekyll build errors for GitHub Pages sites
You're using a CI service that isn't configured to build your publishing source. For example, Travis CI won't build the gh-pages branch unless...
Read more >HTML Standard
Continuing the above example, a requirement stating that a particular attribute's value is constrained to being a valid integer emphatically does not imply ......
Read more >Gatsby Changelog | 5.3.0
Gatsby printed the complete contents of the page data to the terminal. ... dhoko: feat(gatsby-source-wordpress): Fix false positive error if the URL and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

The docs are correct. They omitted the alternative way with the base path though, which we should probably add (it has caveats though, which is why it’s left out though).
What I mean is that you add the
basesetting to yoursvelte.config.jslike you did here and adjust your base path injection here to<base href={base} />(withimport { base } from '$app/paths'), but don’t adjust all your<a hreftags, and then report back if this worked.Yes, there was one. I force-pushed. Sorry for the confusion. That commit had the same external prefetch console errors though.