1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Cloudflareでkuzu-wasmを動かしたメモ

Posted at

概要

Cloudflareに何も設定せずにkuzu-wasmをあげたら、networkにkuzu-wasmが表示されない状態となった。

image.png
一緒にあげていたpgliteのwasmは表示されている。

GitHubPagesでもあった、SharedArrayBufferのエラーが原因。今回は直接表示されなかったので少し手間取った。
ヘッダを設定することで解消した。

この時点のソース

ヘッダの設定

ビルドディレクトリに、_headersファイルを配置することで設定できるもよう*

今回はビルドスクリプトにコピーコマンドを追加し、ビルドディレクトリに含めた。

- apps
  - index.html
  - _headers
  - dist ... このディレクトリをcloudflareでページとして公開
    - _headers   ... ビルド時にコピー
    - index.html ... ビルド時にコピー

ファイル

apps/_headers
# Global headers for all paths
/*
  Cross-Origin-Opener-Policy: same-origin
  Cross-Origin-Embedder-Policy: require-corp

# Additional headers for kuzu-wasm resources if needed
/*.wasm
  Cross-Origin-Opener-Policy: same-origin
  Cross-Origin-Embedder-Policy: require-corp
  Content-Type: application/wasm

参考

GraphDB Kuzu(WebAssembly)をGithub Pagesで動かしたメモ

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?