Skip to content

[Bug]: Failed to load search index (pagefind.js not found) #1930

@constmoon

Description

@constmoon

Package Scope

etc

Bug description

The search functionality on suspensive.org is broken.
When typing a search query, the following error appears:

> Failed to load search index.
> TypeError: Failed to fetch dynamically imported module: https://suspensive.org/pagefind/pagefind.js
Image

The request to https://suspensive.org/_pagefind/pagefind.js returns a 500 Internal Server Error, while the file is correctly generated locally after running pnpm run build.

According to a commit from two days ago(#1929), I found the Next.js version was upgraded and the build script was modified along with it. Could this be related to the Turbo remote cache?

Expected behavior

Matching search results should be displayed, or a "no results" message should be shown if there are no matches.

To Reproduce

  1. Go to https://suspensive.org
  2. Type anything in the search input
  3. Get the error: "Failed to load search index"

Possible Solution

I was considering adding "public/_pagefind/**" to the outputs in turbo.json, since it might not currently cached or restored when Turbo remote cache hits. But since I can't verify your Vercel build configuration, I'm filing this as an issue first.

etc.

No response

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions