capri-js / capri

Build static sites with interactive islands
https://capri.build
MIT License
208 stars 5 forks source link

Preact example is missing dependency "preact-render-to-string" #43

Closed ole-treichel closed 1 year ago

ole-treichel commented 1 year ago

When I create a preact project with npm init capri my-capri-site -- -e preact, the build fails because preact-render-to-string is not installed.

Edit: I just tested by cloning the capri repo and then the example works (after npm install in root).

I am using yarn instead of npm. Maybe that is the problem. I see that @capri-js/preact depends on preact-iso, which in turn depends on preact-render-to-string.

Node: 16.13.2 Yarn: 1.22.15

fgnass commented 1 year ago

Good catch, thank you! I think I missed it, because as you wrote, it works when running things from within the checked-out repo.

As preact-iso lists preact-render-to-string only as peer dependency, I now added it as proper dependency to @capri-js/preact.

Another thing I noticed is, that yarn build currently fails in the preact example due to a bug in wouter. I opened a PR to fix this, too: https://github.com/molefrog/wouter/pull/272

fgnass commented 1 year ago

The fix has been published to npm as @capri-js/preact@5.0.1

ole-treichel commented 1 year ago

Thanks for taking a look and fixing! Can confirm, preact-render-to-string is installed now. Apart from the mentioned bug it seems to work now 👍