brillout / react-streaming

React Streaming. Full-fledged & Easy.
MIT License
220 stars 14 forks source link

Getting an error with `useAsync`. #7

Closed Industrial closed 2 years ago

Industrial commented 2 years ago

Hi!

I'm implementing react-streaming in a minimal setup with Deno and I'm getting this error:

Warning deno task is unstable and may drastically change in the future
Task dev deno task start
Warning deno task is unstable and may drastically change in the future
Task start deno run -A --unstable --no-check server.tsx
Error compiling https://deno.land/std@0.140.0/node/process.ts. Using source.
Error compiling https://deno.land/std@0.141.0/node/process.ts. Using source.
Error compiling https://deno.land/std@0.140.0/node/internal/buffer.mjs. Using source.
Error compiling https://deno.land/std@0.141.0/node/internal/buffer.mjs. Using source.
Error compiling https://deno.land/std@0.140.0/node/internal/errors.ts. Using source.
Error compiling https://deno.land/std@0.141.0/node/internal/errors.ts. Using source.
Listening on http://localhost:8000
<--     GET http://localhost:8000/
Rendering App
[uncaught application error]: TypeError - Cannot read properties of undefined (reading ':R6:')

request: { url: "http://localhost:8000/", method: "GET", hasBody: false }
response: { status: 404, type: undefined, hasBody: false, writable: true }

    at useSsrData (https://esm.sh/v82/react-streaming@0.2.13/deno/react-streaming.development.js:71:19)
    at useAsync (https://esm.sh/v82/react-streaming@0.2.13/deno/react-streaming.development.js:106:10)
    at App (file:///home/tom/Code/code9/test-oak/app/App.tsx:7:18)
    at renderWithHooks (https://esm.sh/v82/react-dom@18.1.0/X-ZC9yZWFjdEAxOC4xLjA/deno/server.development.js:8907:24)
    at renderIndeterminateComponent (https://esm.sh/v82/react-dom@18.1.0/X-ZC9yZWFjdEAxOC4xLjA/deno/server.development.js:8964:23)
    at renderElement (https://esm.sh/v82/react-dom@18.1.0/X-ZC9yZWFjdEAxOC4xLjA/deno/server.development.js:9120:15)
    at renderNodeDestructive (https://esm.sh/v82/react-dom@18.1.0/X-ZC9yZWFjdEAxOC4xLjA/deno/server.development.js:9210:17)
    at renderNode (https://esm.sh/v82/react-dom@18.1.0/X-ZC9yZWFjdEAxOC4xLjA/deno/server.development.js:9300:20)
    at renderHostElement (https://esm.sh/v82/react-dom@18.1.0/X-ZC9yZWFjdEAxOC4xLjA/deno/server.development.js:8896:11)
    at renderElement (https://esm.sh/v82/react-dom@18.1.0/X-ZC9yZWFjdEAxOC4xLjA/deno/server.development.js:9125:13)
<--     GET http://localhost:8000/favicon.ico
--> 200 GET http://localhost:8000/favicon.ico

You can reproduce this with:

git clone https://github.com/Industrial/test-oak.git
cd test-oak
deno task dev
brillout commented 2 years ago

React 18 Streaming cannot render the whole document. Only render the app's view.