素肌にサスペンダー

個人的な備忘と日記

【opencv.js】wasm streaming compile failedが出た時の対応

さくらサーバーのスタンダードプラン(https://rs.sakura.ad.jp/standard.html)で、opencv.jsを使おうとしたら、以下のエラーが出た。

opencv.js:20 wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.

サーバー側でmimeタイプの追加すれば良いようなので、 以下を記述した.htaccessを設置したら、エラーが消えた。

AddType application/wasm wasm