jscanify icon indicating copy to clipboard operation
jscanify copied to clipboard

Error importing jscanify library in React application

Open Hadi311374 opened this issue 9 months ago • 1 comments

I'm experiencing an issue when trying to import and use the jscanify library in a React application. While the CDN approach works fine, importing the library as a module using the import statement causes an error.

import React, { useEffect, useRef, useState } from 'react'; import jscanify from 'jscanify';

export default function PaperScanner() { const canvasRef = useRef(null); const [photoData, setPhotoData] = useState(null);

useEffect(() => { const scanner = new jscanify(); // <-- Error occurs here

}, []);

}

Error Message: TypeError: Cannot set property document of #<Window> which has only a getter

Hadi311374 avatar May 15 '24 11:05 Hadi311374