Deep Suspense and Server Side Rendering
Zolmeister opened this issue · comments
Zolmeister commented
The following works in the browser, but not node.js
{h, useResource, Suspense, render} = require 'dyo/server/dist/dyo.umd.js'
A = ->
useResource ->
Promise.resolve null
h 'div', 'x'
B = ->
# works if uncommented
# h Suspense,
h 'div', A
C = ->
h Suspense, B
stringify = (tree) ->
class Writable
constructor: ->
@innerHTML = ''
@end = @write
write: (value) =>
@innerHTML += value
{innerHTML} = await render tree, new Writable()
return innerHTML
console.log await stringify C
Expected
<div><div>x</div></div>
Received
TypeError: Cannot read property 'identity' of undefined
From what I can tell, it's trying to mutate the DOM (Interface
), which doesn't exist in node.