Cannot read properties of undefined (reading 'lazyLoadMembers'
paul1868 opened this issue · 1 comments
I can send messages but not receive events. Getting this error
matrix:initialize err TypeError: Cannot read properties of undefined (reading 'lazyLoadMembers')
at MatrixClient.createMessagesRequest (client.js:4501:1)
at MatrixReader. (MatrixReader.js:206:1)
at Generator.next ()
at MatrixReader.js:29:1
at new Promise ()
at push../node_modules/matrix-crdt/dist/reader/MatrixReader.js.__awaiter (MatrixReader.js:8:1)
at MatrixReader.getInitialDocumentUpdateEvents (MatrixReader.js:199:1)
at MatrixProvider. (MatrixProvider.js:320:1)
at Generator.next ()
at MatrixProvider.js:31:1
at new Promise ()
at push../node_modules/matrix-crdt/dist/MatrixProvider.js.__awaiter (MatrixProvider.js:10:1)
at MatrixProvider.initializeReader (MatrixProvider.js:307:1)
at MatrixProvider. (MatrixProvider.js:270:1)
at Generator.next ()
at fulfilled (MatrixProvider.js:13:1)
const matrixClient = sdk.createClient({
baseUrl: "https://matrix.org",
accessToken: "xxxxxxx",
userId: "@xxxxx",
lazyLoadMembers: false
});
const mprovider = new MatrixProvider(
YSDoc as Y.Doc,
matrixClient,
{ type: "alias", alias: "#xxxxxxxx" },
undefined,
{
translator: { updatesAsRegularMessages: true },
reader: { snapshotInterval: 10 },
writer: { flushInterval: 500 },
}
);
console.log("matrix:loading");
mprovider.initialize().then(()=>{
console.log("matrix:initialize done");
}).catch((e)=>{
console.error("matrix:initialize err",e);
})
Thanks for reporting this @paul1868 .
Please add the following to the setup of matrixClient
:
matrixClient.canSupportVoip = false;
matrixClient.clientOpts = {
lazyLoadMembers: true,
};
I've updated the readme to reflect this better :) Atm, it's needed because of the way how matrix-js-sdk
works and because we don't use the full sync functionality (but only want to use certain API calls).
Hope this helps,