YousefED / Matrix-CRDT

Use Matrix as a backend for local-first applications with the Matrix-CRDT Yjs provider.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installing via npmjs

rcarjan opened this issue · comments

Hello,
I am trying to install matrix-crdt in an existing angular 15 project, and it seems that the build succeeds, somehow, yet when I access the page in the browser, it's blank. Here is the output from the build command:

yarn install v1.22.19
[1/4] Resolving packages...
error Couldn't find package "@matrix-org/matrix-sdk-crypto-js" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
/docker-entrypoint.sh: Configuration complete; ready for start up
- Generating browser application bundles (phase: setup)...
- Generating index html...
✔ Browser application bundle generation complete.
✔ Index html generation complete.
- Generating service worker...
✔ Service worker generation complete.
- Generating index html...
✔ Browser application bundle generation complete.
✔ Index html generation complete.
- Generating service worker...
✔ Service worker generation complete.

Here is my package.json: https://pastebin.com/XLFQWLXa
And here is my tsconfig.json: https://pastebin.com/fDqMD86H

I've also tried removing matrix-js-sdk from the package.json, since I already import browser-matrix.js, from the same package, which exposes the matrixcs object in the window, yet that doesn't seem to work either. Here is the build output in this scenario:

yarn install v1.22.19
[1/4] Resolving packages...
warning @codemirror/text@0.19.6: As of 0.20.0, this package has been merged into @codemirror/state
warning @angular/cli > pacote > @npmcli/run-script > node-gyp > make-fetch-happen > cacache > @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "codemirror > @codemirror/autocomplete@6.4.2" has unmet peer dependency "@lezer/common@^1.0.0".
warning " > matrix-crdt@0.2.0" has unmet peer dependency "lib0@*".
warning " > matrix-crdt@0.2.0" has unmet peer dependency "matrix-js-sdk@*".
warning " > matrix-crdt@0.2.0" has unmet peer dependency "y-protocols@*".
warning " > thememirror@2.0.1" has unmet peer dependency "@codemirror/language@^6.0.0".
warning " > @angular/localize@15.1.0" has incorrect peer dependency "@angular/compiler@15.1.0".
warning " > @angular/localize@15.1.0" has incorrect peer dependency "@angular/compiler-cli@15.1.0".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 121.34s.
/docker-entrypoint.sh: Configuration complete; ready for start up
- Generating browser application bundles (phase: setup)...
Processing legacy "View Engine" libraries:
- @ngxs/store/internals [es2015/esm2015] (git+https://github.com/ngxs/store.git)
- @ngxs/store [es2015/esm2015] (git+https://github.com/ngxs/store.git)
- @ngxs/logger-plugin [es2015/esm2015] (git+https://github.com/ngxs/store.git)
- @ngxs/storage-plugin [es2015/esm2015] (git+https://github.com/ngxs/store.git)
- @ngxs/store/operators [es2015/esm2015] (git+https://github.com/ngxs/store.git)
Encourage the library authors to publish an Ivy distribution.
- Generating index html...
✔ Browser application bundle generation complete.
✔ Index html generation complete.
- Generating service worker...
✔ Service worker generation complete.
- Generating index html...
✔ Browser application bundle generation complete.
✔ Index html generation complete.
- Generating service worker...
✔ Service worker generation complete.

If I try to revernt to the default angular generated tsconfig ( https://pastebin.com/ndhd1StS ), matrix sdk seems to work, and I can instance a matrixClient, however when I try to import and use a MatrixProvider, this is the output I get: https://pastebin.com/QBDmfjpp

I'm kind of running out of ideas. Is there anything I'm doing wrong? Or does matrix-crdt simply not work with angular?
Any sort of help is greatly appreciated. Thanks!