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

Bug: 'SharedArrayBuffer' is not defined (using v^17.0.2) #21951

Closed
baalimago opened this issue Jul 24, 2021 · 3 comments
Closed

Bug: 'SharedArrayBuffer' is not defined (using v^17.0.2) #21951

baalimago opened this issue Jul 24, 2021 · 3 comments
Labels
Resolution: Support Redirect Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@baalimago
Copy link

Issue:

It says 'SharedArrayBuffer' is not defined when attempting to run project using a shared array buffer

How to recreate:

  1. npx create-react-app test-project
  2. In App.js, add function const test = () => { const b = new SharedArrayBuffer(1024); }
  3. Attempt to start app
  4. Expect:
    image

System:

package.json:

{
  "name": "shared_array_buffer_test",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^11.1.0",
    "@testing-library/user-event": "^12.1.10",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-scripts": "4.0.3",
    "web-vitals": "^1.0.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

Windows 11 (insider build 10.0.22000 Build 22000)
WSL2 - Ubuntu 20.04 LTS

@baalimago baalimago changed the title 'SharedArrayBuffer' is not defined (using v^17.0.2) Bug: 'SharedArrayBuffer' is not defined (using v^17.0.2) Jul 24, 2021
@eps1lon
Copy link
Collaborator

eps1lon commented Jul 24, 2021

Thanks for the feedback.

This lint error originates from react-scripts which is released from facebook/create-react-app. You want to open a new issue in their repository

@eps1lon eps1lon closed this as completed Jul 24, 2021
@eps1lon eps1lon added Resolution: Support Redirect Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug labels Jul 24, 2021
@baalimago
Copy link
Author

baalimago commented Aug 6, 2021

I don't think it's a lint issue.

It's caused by some CORS headers not being set properly (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) in the react development server. It should've been fixed in react >=17.0.2 #20831, but it doesn't seem to work for some reason.

I might add that it's not wsl2 related, I did the same test on ubuntu 20.04 and the behaviour is the same.

@siddharthroy12
Copy link

I'm having the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Support Redirect Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

3 participants