Skip to content

Commit

Permalink
fix(prod-server): ssr cache would return error result when use stream…
Browse files Browse the repository at this point in the history
… ssr (#5281)
  • Loading branch information
GiveMe-A-Name authored Jan 22, 2024
1 parent 8f28bda commit 01b75e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/short-wolves-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@modern-js/prod-server': patch
---

fix(prod-server): ssr cache would return error result when use stream ssr
fix(prod-server): 使用 stream ssr 时, ssr 缓存将会返回错误结果
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class CacheManager {
await this.container.set(key, JSON.stringify(cache), { ttl });
return renderResult;
} else {
let html: string;
let html = '';
const stream = new Transform({
write(chunk, _, callback) {
html += chunk.toString();
Expand Down

0 comments on commit 01b75e6

Please sign in to comment.