I think there is some path config issue in dev mode for pagefind.js. I was able to get around it using the following steps:
ln -s node_modules/@getcanary/docusaurus-theme-search-pagefind/dist/pagefind.js static/pagefind-dev.js
npm run swizzle @getcanary/docusaurus-theme-search-pagefind SearchBar -- --eject
- In
src/theme/SearchBar/index.jsx L13:
React.useEffect(() => {
const prod = process.env.NODE_ENV === "production"
const lib = prod ? `${siteConfig.baseUrl}pagefind/pagefind.js` : `${siteConfig.baseUrl}pagefind-dev.js`
setPath(lib);
}, [siteConfig]);
Just wanted to document that in case it can be streamlined in the theme itself!
I think there is some path config issue in dev mode for
pagefind.js. I was able to get around it using the following steps:ln -s node_modules/@getcanary/docusaurus-theme-search-pagefind/dist/pagefind.js static/pagefind-dev.jsnpm run swizzle @getcanary/docusaurus-theme-search-pagefind SearchBar -- --ejectsrc/theme/SearchBar/index.jsxL13:Just wanted to document that in case it can be streamlined in the theme itself!