You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I thought I'd just raise an issue for this as I was unsure of a good workaround.
I ran into an issue when using Yjs with Angular. Namely, since it is still run under a node environment, the lib0 library attempts to use node's crypto instead of browser crypto. (see this line
However, Angular did not like this since it doesn't want to expose core node modules in this way to the frontend (understandable) - it would give an error saying it could not resolve requiring crypto.
My workaround, in this case, was just to remove this line altogether and modify the rest of the file such that it only uses browser crypto.
I just thought I'd make you, and anyone else that got as far as figuring this out, aware of the issue.
Maybe perhaps there is a better way of determining the environment?
The text was updated successfully, but these errors were encountered:
Hi,
I thought I'd just raise an issue for this as I was unsure of a good workaround.
I ran into an issue when using Yjs with Angular. Namely, since it is still run under a node environment, the lib0 library attempts to use node's crypto instead of browser crypto. (see this line
lib0/random.js
Line 11 in 17d4bee
However, Angular did not like this since it doesn't want to expose core node modules in this way to the frontend (understandable) - it would give an error saying it could not resolve requiring crypto.
My workaround, in this case, was just to remove this line altogether and modify the rest of the file such that it only uses browser crypto.
I just thought I'd make you, and anyone else that got as far as figuring this out, aware of the issue.
Maybe perhaps there is a better way of determining the environment?
The text was updated successfully, but these errors were encountered: