For the Docu: Vite and CORS
rowild opened this issue · 3 comments
rowild commented
In case somebody uses Vite: Vite seems to require some special CORS configuration to be able to read SharedBufferArray. A solution would be this:
chaosprint/vite-plugin-cross-origin-isolation#3
or this vite plugin:
https://github.com/chaosprint/vite-plugin-cross-origin-isolation
guyettinger commented
If you don't have the ability to configure cross origin isolation on the server (i.e. github pages), you can also use a coi-serviceworker in your webpage:
<script src="coi-serviceworker.js"></script>
mkkellogg commented
I'm going to close this issue, but I will add this info to the README.
MengtianWen commented
If you need to deploy your project to a server via Nginx, you can also achieve cross-origin isolation via Nginx configuration:
server {
listen 80;
listen [::]:80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
add_header 'Cross-Origin-Embedder-Policy' 'require-corp';
add_header 'Cross-Origin-Opener-Policy' 'same-origin';
}
}