tbolis / react-sketch

Sketch Tool for React-based applications, backed up by FabricJS
http://tbolis.github.io/showcase/react-sketch/
MIT License
680 stars 230 forks source link

ReferenceError: SharedArrayBuffer is not defined #126

Closed tsafs closed 1 year ago

tsafs commented 3 years ago

Hi

Thanks for the module, it's been giving me a good idea of what I can do with the canvas. I will not be using this module anymore, but just found an error that you might be interested in.

It's occurring on the latest React version with the latest react-sketch version and only on the latest versions (probably also earlier versions) of Firefox, Firefox Mobile, Opera Mobile, others I haven't tested.

ReferenceError: SharedArrayBuffer is not defined
./node_modules/webidl-conversions/lib/index.js
C:/Users/Sebastian/Projects/Cards/client_new/node_modules/webidl-conversions/lib/index.js:347

  344 | 
  345 | const abByteLengthGetter =
  346 |     Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get;
> 347 | const sabByteLengthGetter =
  348 |     Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, "byteLength").get;
  349 | 
  350 | function isNonSharedArrayBuffer(V) {

It is because those browsers do not support SharedArrayBuffer.

I haven't dug deeper into the issue, because I'm dropping your module from my work, but here you go.

Happy hacking 👍

amitnjha commented 3 years ago

I am facing same error. It seems the component is not compatible with React 17, It works fine with React 16.

scand1sk commented 3 years ago

i ran the same error. I am still with React 16, for me it was triggered when I upgraded react-scripts to v4.x.x.

scand1sk commented 3 years ago

Upgrading react-sketch to 0.5.7 (using the npm module "react-sketch2") seems to have solved my issue.

LaurentGENTY commented 1 year ago

Upgrading react-sketch to 0.5.7 (using the npm module "react-sketch2") seems to have solved my issue.

Solved issue too