/Users/himself65/Library/Caches/fnm_multishells/21236_1708164902479/bin/pnpm run dev
> waku-starter@0.1.0 dev /Users/himself65/Code/waku/examples/01_template
> waku dev
ready: Listening on http://localhost:3000/
rerendering...
node:internal/event_target:1088
process.nextTick(() => { throw err; });
^
ELIFECYCLE Command failed.
Process finished with exit code 134 (interrupted by signal 6:SIGABRT)
Step:
Modify example_01 with following changes:
// actions/index.ts
"use server"
import { RenderContext } from 'waku/server'
export const fakeDatabase = {
userName: 'NONE',
message: null as ReadableStream<string> | null,
}
export async function rerender(this: RenderContext) {
console.log('rerendering...')
fakeDatabase.userName = crypto.randomUUID()
fakeDatabase.message = new ReadableStream({
start(controller) {
controller.enqueue('Hello')
let i = 0
setInterval(() => {
if (i > 3) {
controller.close()
return
}
controller.enqueue(`Message ${i++}`)
}, 10)
}
})
this.rerender('')
}
Step:
Modify example_01 with following changes: