-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
TypeError: Cannot read property 'getRandomValues' of undefined #6563
Comments
Thank you for reporting! Definitely seems like a bug... |
Doesn't seem like that specific change (576a02a#diff-ddf3f6ae6821e1502f6a41d26c52c8a8R13) did anything but tweak formatting of that line. Seems like the real culprit was the original identifiers PR (#6247). In the current code, we have this: data/packages/store/addon/-private/identifiers/utils/uuid-v4.ts Lines 12 to 15 in 835fd28
In FastBoot We then call data/packages/store/addon/-private/identifiers/utils/uuid-v4.ts Lines 18 to 23 in 835fd28
Which is called unconditionally in the default export of data/packages/store/addon/-private/identifiers/utils/uuid-v4.ts Lines 61 to 69 in 835fd28
Which is ultimately called from the default identifier generator (which is used during data/packages/store/addon/-private/identifiers/cache.ts Lines 61 to 70 in 576a02a
@runspired - Mind giving a quick brain dump on how this is supposed to be working in FastBoot? I don't see how |
I wonder if this is something that should be improved in fastboot itself, ie incorporating nodejs 'crypto' module and making it available, or if it is more the responsibility of ember-data to provide that. |
It is definitely possible for ember-data to |
We would want to require node crypto JIT. Before identifiers, Users shouldn’t have been using createRecord in fastboot though, and it still feels weird to me, although I don’t see much of an alternative pattern in today’s shoebox pattern |
Doesn't really seem like a shoebox thing to me, calling |
Because there's no way to stash the state for rehydration today. Identifiers at least makes it possible to rehydrate that state, still feels weird to be rehydrating "mutations" in this way. |
It is also not about storing partial mutations across the SSR -> client boundary. The pattern I'm talking about is where you'd have a |
FWIW, I discussed this more with @runspired in chat. We were talking about different kinds of mutations and completely talking past each other above. Sorry about that @runspired. RE: this specific issue, we are definitely agree that we need to fix (likely by way of |
I took a first stab at this over in #6568. I'm not super tied to the specific implementation and if we don't want to go that route we can throw away the implementation commit and just use the test commit. |
Thank you guys for the amazing job done! |
Reproduction
Description
Creating a new record to the store raises the error
TypeError: Cannot read property 'getRandomValues' of undefined
when page is loaded with fastboot.Probably this commit has introduced the issue: 576a02a#diff-ddf3f6ae6821e1502f6a41d26c52c8a8R13
Versions
Ember cli:
3.13.1
Ember data:
3.13.1
Ember source:
3.12.0
The text was updated successfully, but these errors were encountered: