question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unhandled Rejection - Cannot read property 'generateKey'

See original GitHub issue

Hi,

When i start a live collaboration i receive the Error web page : Can you help me and explain me how i can generate the key on my server ?

Regards,

Unhandled Rejection (TypeError): Cannot read property ‘generateKey’ of undefined

generateEncryptionKey src/excalidraw/src/data/index.ts:86 83 | } 84 | 85 | async function generateEncryptionKey() {

86 | const key = await window.crypto.subtle.generateKey( 87 | { 88 | name: “AES-GCM”, 89 | length: 128, View compiled

generateCollaborationLink src/excalidraw/src/data/index.ts:112 109 | 110 | export async function generateCollaborationLink() { 111 | const id = await generateRandomID();

112 | const key = await generateEncryptionKey(); 113 | return ${window.location.origin}${window.location.pathname}#room=${id},${key}; 114 | } 115 | View compiled async App.openPortal src/excalidraw/src/components/App.tsx:759 756 | }; 757 | 758 | openPortal = async () => { 759 | window.history.pushState( | ^ 760 | {}, 761 | “Excalidraw”, 762 | await generateCollaborationLink(), View compiled This screen is visible only in development. It will not appear if the app crashes in production.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dwellecommented, Dec 10, 2020

@MartinP7r sorry, I must have missed your reply.

Yes, you should update your .env or wherever you supply ENV variables.

The JSON server repo is here: https://github.com/excalidraw/excalidraw-json

Also note that we’ll be soon releasing a new npm package under @excalidraw/excalidraw where it’ll be easy to implement your own backend(s). We should eventually get around to writing up how to do that, but before then you can to read the source of code of this repo since we’ve already factored out the backend logic from the core, and are using the same API to implement the backends for excalidraw.com

Cheers.

0reactions
MartinP7rcommented, Dec 11, 2020

@dwelle thanks a lot for letting me know!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unhandled Rejection (TypeError): Cannot read properties of ...
I'm using react and redux to create simple user authentication. When I click on the login button the user get's authenticated, ...
Read more >
Unhandled Rejection (TypeError): Cannot read properties of ...
Forum Thread - Unhandled Rejection (TypeError): Cannot read properties of undefined (reading 'getElementsByClassName') - React - EJ 2.
Read more >
SubtleCrypto.generateKey() - Web APIs | MDN
The promise is rejected when the following exception is encountered: SyntaxError DOMException. Raised when the result is a CryptoKey of type ...
Read more >
openpgpjs/openpgpjs - Gitter
(node:387676) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined at Reader.readBytes (C:\Users\Tore\Documents\GitHub\ ...
Read more >
Getting Error: Cannot read property '__payloadclass' of null
Unhandled rejection TypeError: Cannot read property '__payloadClass' of null. at C:\Kore ai\BotKit-master\lib\sdk\lib\requestStore.js:30:54.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found