DEV Community

Fix 'SharedArrayBuffer is not defined': a practical guide to cross-origin isolation (opens in new tab)

Discussed on DEV

If you've ever seen this in the console: Uncaught ReferenceError: SharedArrayBuffer is not defined or your multithreaded WebAssembly quietly fell back to a single thread, the cause is almost always the same thing: your page is not cross-origin isolated. Here's what that means, why the browser does it, and exactly how to fix it. TL;DR Send these two headers on the response for the document that loads your code: Cross-Origin-Opener-Policy: same-origin Cross-Origin-Embedder-Policy: require-corp ...

Read the original article
Sign in to keep reading the full article.

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help