CloudCannon / pagefind

Static low-bandwidth search at scale
https://pagefind.app
MIT License
3.34k stars 100 forks source link

Console warnings while loading `pagefind` via modules #424

Closed itsmatteomanf closed 11 months ago

itsmatteomanf commented 11 months ago

I have in my project Pagefind loaded via import { PagefindUI } from "@pagefind/default-ui", which works great, but fails this test, causing 3 warnings in the console.

https://github.com/CloudCannon/pagefind/blob/697e93973c5a601a8f3fcd76a5f1a7e463f8ea5f/pagefind_ui/default/ui-core.js#L4-L19

Setting a bundlePath doesn't solve it, as my files are actually in the default path, just the init script isn't.

An example of this happening is in https://starlight.astro.build/.

bglw commented 11 months ago

Ah! My bad.

I'll get that fixed up, and I'll also see if I can get that import flow into our integration test suite, as those tests assert that Pagefind doesn't log anything to the console.

Thanks for pointing this out! 💜

itsmatteomanf commented 11 months ago

No problem, issues happen :) I did wonder for a moment what I was doing wrong that caused that... then looked at the code in here.

Thanks for Pagefind itself :D

bglw commented 11 months ago

A fix for this is sitting on v1.0.3-rc0, pending a stable release tomorrow.

bglw commented 11 months ago

And released on v1.0.3 :)