Closed danielblignaut closed 9 months ago
Additionally I've also seen a single request fail with this stack trace and error from the exact same line mentioned above in our source code:
TypeError contentRefs[(info & binary.BITS5)] is not a function
/node_modules/yjs/dist/yjs.mjs in readItemContent at line 10014:76
/node_modules/yjs/dist/yjs.mjs in readClientsStructRefs at line 1400:13
/node_modules/yjs/dist/yjs.mjs in <anonymous> at line 1627:16
/node_modules/yjs/dist/yjs.mjs in transact at line 3354:14
/node_modules/yjs/dist/yjs.mjs in readUpdateV2 at line 1620:3
/node_modules/yjs/dist/yjs.mjs in applyUpdateV2 at line 1715:3
/node_modules/yjs/dist/yjs.mjs in applyUpdate at line 1729:58
which is making me wonder if there's perhaps an issue in some of the Node.JS implementation?
Originally opened the ticket against Y.JS whom referred me here instead - https://github.com/yjs/yjs/issues/599
weird! Can you send me your app id (either to humans@tiptap.dev, or in Discord), and if possible dates / times at which you get these errors (maybe screenshots vom Sentry)? Will check if I can find anything in our logs then.
Was the cause discovered? We're having the same issue and can reproduce it reliably with our unit test.
the issue means that the ydoc update is not valid. Some libraries (here fetch) are somehow breaking some parts of it, it works reliably when using axios and specifying arraybuffer as response type (as mentioned in our docs: https://tiptap.dev/docs/editor/cloud#get-document).
For anyone stumbling into this problem - or for search purposes, any other problem with node-fetch
and TipTap - support confirmed that this is still an open issue. I ran into other issues that might have been related to node-fetch with TipTap but hard to say for certain.
In the meantime, the best advice seems to be to only use Axios with TipTap. Hopefully, TipTap will re-open this issue and fix it; and update their docs in the meantime to reflect the known issue.
Checklist
Describe the bug
Our Sentry instance is intermittently receiving this RangeError ->
For context, in our code, we have code around this exception like so:
Following the stack trace, the problematic line seems to come from the underlying lib0 library:
I'm unfamiliar with the restrictions around Uint8Arrays but I suspect there's one of 2 things going wrong:
To Reproduce
Unfortunately I can't reproduce the issue, it seems to happen intermittently and I am not receiving any bad responses from TipTap Although ArrayBuffers / Uint8Arrays are not very human readable in the first place.
Have you seen an issue like this before?
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Environment Information
Additional context