Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(analyze): Disable cache during base64 decode #838

Merged
merged 1 commit into from
May 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions analyze/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ const wasmBase64 = "data:application/wasm;base64,${wasm.toString("base64")}";
*/
// TODO: Switch back to top-level await when our platforms all support it
export async function wasm() {
// This uses fetch to decode the wasm data url
const wasmDecode = await fetch(wasmBase64);
// This uses fetch to decode the wasm data url, but disabling cache so files
// larger than 2mb don't fail to parse in the Next.js App Router
const wasmDecode = await fetch(wasmBase64, { cache: "no-store" });
const buf = await wasmDecode.arrayBuffer();
// And then we return it as a WebAssembly.Module
return WebAssembly.compile(buf);
Expand Down
Loading