withmono / connect.js

MIT License
17 stars 22 forks source link

@mono.co/connect.js crashes Nextjs app #43

Closed CRIMSON-CORP closed 1 year ago

CRIMSON-CORP commented 2 years ago

Summary

App crashes when monoInstance.setup() is called For bug reports, include detailed steps to reproduce or a minimal reproduction of the issue

Other information

This is due to document not defined in Nodejs Server in Nextjs, please make this compatible with Nexjs

visual issues

Is this specific to one device, or does it happen on multiple devices? Screenshot 2022-10-19 154752 Screenshot 2022-10-19 154848

My current solution

By checking if youre on the server on the client, one can stop the app from crashing

Screenshot 2022-10-19 161916

umar-abdullahi commented 1 year ago

this is a known issue on isomorphic codebase, please refer to our nextjs implementation here https://github.com/withmono/connect.js/blob/develop/docs/examples/nextjs.md @CRIMSON-CORP