Skip to content

[DEAD APP ON CHROME] ReferenceError: SharedArrayBuffer is not defined #2

@garbusbeach

Description

@garbusbeach

The App is unable to create instance of SharedArrayBuffer (src/voxel-block-builder.js), because of lack of CORS isolation.

Uncaught ReferenceError: SharedArrayBuffer is not defined
    at _VoxelBuilderThreadedWorker.BuildMeshDataFromVoxels_ (voxel-block-builder.js:1300:17)
    at _VoxelBuilderThreadedWorker.Rebuild (voxel-block-builder.js:1174:25)
    at self.onmessage (voxel-builder-threaded-worker.js:11:32)

Starting in Chrome 92, functionalities that use SharedArrayBuffer will no longer work without cross-origin isolation. If you landed on this page due to a SharedArrayBuffer deprecation message, it's likely either your website or one of the resources embedded on it is using SharedArrayBuffer. To ensure nothing breaks on your website due to deprecation, start by identifying where it's used. (https://web.dev/cross-origin-isolation-guide/)

Env: Chrome Version 97.0.4692.99 (Official Build) (arm64), Mac OSX 12.1

Steps to reproduce:

  1. go to the https://www.simondev.io/tutorials/Minecraft2/demo/

How to fix:

  1. add Cross-Origin-Opener-Policy: same-origin and Cross-Origin-Embedder-Policy: require-corp header to main html file.
  2. check if crossOriginIsolated returns true in devtools console.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions