puffinsoft / jscanify

Open-source Javascript mobile document scanner.
https://puffinsoft.github.io/jscanify/
MIT License
940 stars 51 forks source link

Doesn't work in web (React) #8

Closed Avinamor closed 1 year ago

Avinamor commented 1 year ago

Hey!

I was trying to use the package on the FE side (React) but faced several issues. If I install it via npm (in my case pnpm, but I guess it doesn't matter) it fails with the error. It requires Node.js variable process. If I use it via CDN, its dependency - opencv.js requires Node.js variable process.

Error: Uncaught ReferenceError: process is not defined

Could you please clarify if it's possible to use this lib in React? If you do - please clarify the steps to use it. The React example didn't help...

kennarddh commented 1 year ago

There is an example how to use it with react but it doesn't use regular import

https://github.com/ColonelParrot/react-scanify-demo

You need to add the script in index.html

https://github.com/ColonelParrot/react-scanify-demo/blob/master/index.html#L12

ColonelParrot commented 1 year ago

Duplicate of #7

ColonelParrot commented 1 year ago

Hello, This is on my bucket list, but it will take quite some time to get a stable fix out. For now, please stick with the official example!