axenda / zatca

An unofficial package to help developers implement ZATCA (Fatoora) QR code easily which is required for e-invoicing in Saudi Arabia.
MIT License
54 stars 13 forks source link

react-scripts ^5.0.0 support (Buffer is not defined) #4

Closed mehroozak closed 2 years ago

mehroozak commented 2 years ago

After updating my existing project to react-scripts ^5.0.0 i have faced an error which is

Uncaught (in promise) ReferenceError: Buffer is not defined

this is because of Buffer is removed in react-scripts ^5.0.0

the issue is in functions named [toHex, toTlv] at the time of creating new object of Invoice

Testing environment:

Thanks image

marshadri commented 2 years ago

This PR can help to resolve this issue https://github.com/axenda/zatca/pull/3