honojs / honox

HonoX - Hono based meta framework
https://hono.dev
MIT License
1.29k stars 38 forks source link

valtio not working #206

Open aretrace opened 1 month ago

aretrace commented 1 month ago

What version of HonoX are you using?

0.1.23

What steps can reproduce the bug?

  1. select x-basic template
  2. transition app from hono/jsx to @hono/react-renderer
  3. install valtio: npm i valtio
  4. replace counter island do with valtio counter:
    
    import { proxy, useSnapshot } from "valtio";

const state = proxy({ count: 0 });

export default function Counter() { const snap = useSnapshot(state); return (

{snap.count}

); }


5. `npm run dev`

### What is the expected behavior?

a basic incremental counter demo rendering and working

### What do you see instead?

module is not defined
    at eval (/.../node_modules/use-sync-external-store/shim/index.js:8:3)
    at instantiateModule (file:///.../node_modules/vite/dist/node/chunks/dep-D8YhmIY-.js:53453:11

> [vite] Error when evaluating SSR module /node_modules/use-sync-external-store/shim/index.js:
|- ReferenceError: module is not defined

### Additional information

valtio: https://valtio.pmnd.rs
> [valtio-signal](https://github.com/valtiojs/valtio-signal) seems to be working, [jotai](https://jotai.org/) test counter also works
dai-shi commented 1 month ago

Valtio v2 may help: npm i valtio@next

aretrace commented 1 month ago

Using Valtio v2:

I encourage testing for each package combinatorial use case as errors differ in most individual cases of a particular mix.