-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error publishing to Cloudflare: "generating random values ... can only be performed while handling a request" #10
Comments
@arv wdyt? |
On further investigation, it looks like the load-time call to uuid has been fixed in Replicache 13. Perhaps we should do the same thing on the 12 branch. |
Like I said the crypto namespace is implemented, so the undefined check
doesn’t work. You’re just not allowed to call it at module init time.
13 doesn’t have this problem because it doesn’t call to crypto.randomUUID
until later.
On Tue, May 9, 2023 at 12:26 AM Erik Arvidsson ***@***.***> wrote:
It is already in v12
[image: Screenshot 2023-05-09 at 12 21 09]
<https://user-images.githubusercontent.com/45845/237068065-0e54fd68-8b9b-4744-a905-447602e09280.png>
***@***.***
<rocicorp/replicache-internal@9982954>
Do you know what versions of replicache and replicache-transaction they
had?
—
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAATUBE6WDUFTTGA6UZLK5TXFILUZANCNFSM6AAAAAAX27AHUQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
a (phone)
|
I did some more research here. This is the change that we did on mono to fix this: https://github.com/rocicorp/mono/commit/8e83d2bcf375ebe89feb77231acde8afb0c91814 and here is the same patch on replicache-internal/v12 I hear that you say that we do not call these function in v13 but we call them in v12. I have not been able to find such a place. I put a breakpoint next to the What version of replicache-transaction & replicache as the costumer using? Is it possible they imported something from replicache and called it manually? |
If you see it again you can always check the |
This was reported by a user. Debugging with him what's happening is that
replicache-transaction
relies onreplicache
for some helper functions (probably wasn't a great idea). Andreplicache
has some load-time code that callscrypto.randomUUID()
.The
crypto
namespace is implemented by CF workers, but you're not allowed to use it outside of a request, apparently.Not sure what the right solution is here. I think the user can work around either by undefining crypto, or else dynamically loading the module. But other users of replicache-transaction on cf will hit the same problem.
The text was updated successfully, but these errors were encountered: