shishkin / astro-pagefind

Astro integration for Pagefind static site search.
MIT License
267 stars 15 forks source link

TS error caused by "hybrid" output mode not available anymore on Astro 5 #90

Open ref-thomasledoux1 opened 2 months ago

ref-thomasledoux1 commented 2 months ago

When upgrading to Astro v5 (beta), I noticed that my build started failing on node_modules/astro-pagefind/src/pagefind.ts. The error is caused by a check for config.output where it's compared to hybrid. Since this output mode doesn't exist anymore in v5 of Astro, the check fails. Not sure how you could fix it without breaking it for v4 (and before) users though..

Screenshot 2024-09-22 at 13 35 53
shishkin commented 2 months ago

Thanks for the heads-up. We can always cast it to string before comparing. I need to check again if I can simplify this code in newer Astro versions. Basically, config.outDir supposed to be enough but I had issues with it in hybrid before.

dallyh commented 3 days ago

I've now encountered another issue which comes with Astro 5 and this integration. I'm using node adapter and the files are built into dist whereas astro with node builds client assets into dist/client. It is probably caused by the condition of output === hybrid which is not met.

I guess for now simply a config option to manually set the outdir could work.