dai-shi / waku

⛩️ The minimal React framework
https://waku.gg
MIT License
3.91k stars 102 forks source link

dev: error when using locally linked version of waku #676

Open pmelab opened 3 weeks ago

pmelab commented 3 weeks ago

I'm trying to link a local version of Waku into our own project code to quickly iterate on PR's and test them in a real use case, but I keep getting the follow error:

TypeError: Cannot read properties of null (reading 'use')
    at react_production_min.use ([...]/waku-test/dist/ssr/assets/rsc0-b97afaf68.js:324:22)
    at Slot ([...]/waku-test/dist/ssr/assets/rsc0-b97afaf68.js:10168:40)

Can be reproduced by:

git clone git@github.com:dai-shi/waku.git
cd waku
pnpm install
pnpm compile
cd ..
pnpm create waku # choose name 'waku-test'
cd waku-test
pnpm remove waku
pnpm add ../waku/packages/waku
pnpm build

Did anybody encounter this or have an idea what could cause it?

dai-shi commented 3 weeks ago

How about pnpm link?

pmelab commented 3 weeks ago

🙈 I completely forgot that pnpm link exists. Thank you for jogging my mind!

But it yields the same result.

dai-shi commented 3 weeks ago

Yeah, now I remember that I probably tried it before. (I wonder if @himself65 has any idea.)

It probably fails with similar issue like #429. We want to fix it and your investigation is welcome.

For the moment, the way it works is to use npm (or maybe yarn) and replace node_modules/waku/dist. You need to copy the files because symbolic link doesn't work.

pmelab commented 2 weeks ago

I have to integrate it into a monorepo setup as well. I will keep an eye open and report back.