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';
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 # which has only a getter