When I used PaperMod theme’s basic sample config to config my site, an error kept popping out whenever I opened the search page:

// ../index.json
Failed to load resource: the server responded with a status of 404 (Not Found)

As expected, the search function was not working either.

PaperMod has a FAQ related to this problem, but the solution is only for sites using a CDN to server assets from a different domain, but it’s not the case here.

In the end, I found my solution on PaperMod’s features page.

The problem is that PaperMod uses Fuse.js to for its search functionality, and the following config, which is not included in the sample config, is fundamental to make it work:

outputs:
    home:
        - HTML
        - RSS
        - JSON # is necessary

After adding this to config.yml, the search page works perfectly.