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

[v3] The server must emit the COOP/COEP response headers to enable those (Warning) #2997

Open
pieterjanmaes opened this issue Jan 18, 2025 · 1 comment

Comments

@pieterjanmaes
Copy link

Hi,

When I navigate with NuxtLink I get following warning when I navigate the first time:

Ignoring inability to install OPFS sqlite3_vfs: Cannot install OPFS: Missing SharedArrayBuffer and/or Atomics. The server must emit the COOP/COEP response headers to enable those. See https://sqlite.org/wasm/doc/trunk/persistence.md#coop-coep

How can I add COOP/COEP response headers to the queryCollection composable?

dependencies used:

  • "@nuxt/content": "^3.0.0"
  • "nuxt": "^3.15.2"
  • "vue": "latest"
  • "vue-router": "latest"
@lenndewolten
Copy link

lenndewolten commented Jan 21, 2025

I encountered the same issue when deploying on Cloudflare Pages and resolved it by specifying the missing headers.
To fix this create a _headers file in the root directory of your project with the following content:

/*
  Cross-Origin-Opener-Policy: same-origin
  Cross-Origin-Embedder-Policy: require-corp

These headers are required for enabling cross-origin isolation, which allows features like OPFS.
The /* is a wildcard that enables these headers on every url.

A redeploy will resolve the warning. If you are using a different hosting provider, the fix will be the same, but the method for specifying headers may differ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants