Troubleshooting
-
dsbridge package not recognized :
- Framework is Node.js powered
- Delete node modules
- Install node modules and synapse-js-sdk again
- Framework is ES6 JS
- Follow ES6 JS integration doc
- Framework is Node.js powered
-
If Merchant uses Next.js and is getting the following error
Uncaught ReferenceError: window is not defined
This is because, synapse-js-sdk
is a client side library and it is trying to be rendered at server end.
- One way to resolve this, use next/dynamic along with useEffect lifecycle hook, if this doesn't work, you can use
- Only useEffect to initialise synapse. The following code demonstrates the same (This is written in JS, if the PWA also uses JS, please mention the methods and constructors explicitly because Intellisense sometimes does not work as expected)