Skip to content

Replace error logging with silent skip when page DNE - #2885

Merged
gerteck merged 12 commits into
MarkBind:masterfrom
MoshiMoshiMochi:bug/pagefind-resolve-serve-onepage-error
Apr 16, 2026
Merged

Replace error logging with silent skip when page DNE#2885
gerteck merged 12 commits into
MarkBind:masterfrom
MoshiMoshiMochi:bug/pagefind-resolve-serve-onepage-error

Conversation

@MoshiMoshiMochi

@MoshiMoshiMochiMoshiMoshiMochi commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Pages that exist get indexed normally while pages that don't are skipped silently without returning an error message for missing pages.

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • DevOps
  • Improve developer experience
  • Others, please explain:

Overview of changes:
#2882
Replace error logging with silent skip if page does not exist when serving one-page.

Anything you'd like to highlight/discuss:

There should no longer be any pagefind related indexing errors when serving one-page.
image

This issue arose from #2880, where I began switching the searchable page logic to respect page's option. It was an oversight an oversight by me during development as I had only tested the indexing with a full build. However, using markbind serve -o only the landing page is built at startup. The sitePages.pages array contains all pages defined in site.json, but most of their HTML files haven't been generated yet as they are built on-demand when u navigate to them.

As prof @damithc mentioned,

In fact it is because these pages don't exist when using -o flag. I think we should not show those as errors in the console, as missing pages is expected when using -o mode.

Hence, I added a check if a file exist first. If it doesn't & is serving one-page, silently skip to the next file to index. This ensures that the failed to index error doesn't occur because the file did not exist.

This is 100% my bad and on me, my apologies for not realising this earlier. Will be sure to be more thorough when testing out newly added/updated features in the future.

Testing instructions:

Proposed commit message: (wrap lines at 72 characters)

Add silent skip when indexing a page that does not exist


Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No unrelated changes

Reviewer checklist:

Indicate the SEMVER impact of the PR:

  • Major (when you make incompatible API changes)
  • Minor (when you add functionality in a backward compatible manner)
  • Patch (when you make backward compatible bug fixes)

At the end of the review, please label the PR with the appropriate label: r.Major, r.Minor, r.Patch.

Breaking change release note preparation (if applicable):

  • To be included in the release note for any feature that is made obsolete/breaking

Give a brief explanation note about:

  • what was the old feature that was made obsolete
  • any replacement feature (if any), and
  • how the author should modify his website to migrate from the old feature to the replacement feature (if possible).

Pages that exist get indexed normally while pages that don't are skipped
silently without returning an error message for missing pages.
Included a check for if serving using onepage so that the error is still
raised if the file does not exist when the user serves a full build.
@codecov

codecovBot commented Apr 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.32%. Comparing base (4427a40) to head (58382e3).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@ Coverage Diff @@## master #2885 +/- ##
==========================================
- Coverage 71.35% 71.32% -0.03% 
==========================================
Files 133 133 Lines 7229 7232 +3 Branches 1712 1705 -7 ==========================================
Hits 5158 5158 - Misses 1970 1973 +3 
Partials 101 101 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MoshiMoshiMochi
MoshiMoshiMochi marked this pull request as ready for review April 6, 2026 11:20
@MoshiMoshiMochi
MoshiMoshiMochi requested a review from a teamApril 6, 2026 11:20
@gerteck

gerteck commented Apr 6, 2026

Copy link
Copy Markdown
Member

no worries @MoshiMoshiMochi , it is but a edge case that is not breaking 😄

Speedy quick fix!

if anything, these nits should be caught by the PR reviewer as well 😅

It could also mean our testcases are not comprehensive enough, to which we can improve on!

@MoshiMoshiMochi

Copy link
Copy Markdown
ContributorAuthor

As discussed, I've update enabling pagefind to its' own option where it is disabled by default. Users will now what to enable it within by declaring the pagefind configuration and setting enablePagefind to true

{
"pagefind": {
"enablePagefind": true
}
}

Hence, as it is no longer tied to enableSearch which is true by default, all functional tests no longer captures pagefind.

Comment threadpackages/core/src/Site/SiteGenerationManager.ts
MoshiMoshiMochiand others added 4 commits April 16, 2026 18:30
* Add skills commands
* Add symlink logic for each agent
* Add tests
* Improve error handling
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Fix bugs
* Lint copilot suggestion
* Fix windows bug
* Update docs
* Add markbind repo check
* Update tests
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

@gerteckgerteck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@gerteck
gerteck merged commit afa3cbc into MarkBind:masterApr 16, 2026
10 of 11 checks passed
@github-actionsgithub-actionsBot added the r.Patch Version resolver: increment by 0.0.1 label Apr 16, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

r.PatchVersion resolver: increment by 0.0.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@MoshiMoshiMochi@gerteck@yihao03