You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The console will display ‘Uncaught SyntaxError: Unexpected token '<'’.And when I open the gif.worker.js file on the console, the index.html file is displayed.
The text was updated successfully, but these errors were encountered:
You need to use the workerScript option to point to a path where the gif.worker.js is served.
Create React App loves to serve index.html, it does it any time it doesn't find a file, instead of a 404.
Try putting the gif.worker.js somewhere in the public folder, and find where you can load the file from the server, then update workerScript to match that path.
Or you could try loading the worker from a Blob, pasting in the gif.worker.js into a string:
varworkerStr=`...`;// worker code as a string.varworkerBlob=newBlob([workerStr],{type: 'application/javascript'});vargif=newGIF({workers: 2,workerScript: URL.createObjectURL(workerBlob),quality: 10});
CRA requires public files to be accessed via the %PUBLIC_URL% environment variable.
Which means that in scripts you need to define the workerScript like
The console will display ‘Uncaught SyntaxError: Unexpected token '<'’.And when I open the gif.worker.js file on the console, the index.html file is displayed.
The text was updated successfully, but these errors were encountered: