yjs / yjs-demos

A collection of demos for Yjs
https://demos.yjs.dev
The Unlicense
750 stars 120 forks source link

prosemirror-dat demo broken? #18

Closed mgielda closed 4 years ago

mgielda commented 4 years ago

The prosemirror-dat demo does not work for me - during npm install I get:

[419] ./prosemirror.js + 62 modules 919 KiB {0} [built]
      | ./prosemirror.js 2.04 KiB [built]
      | ./schema.js 5.74 KiB [built]
      |     + 61 hidden modules
    + 409 hidden modules

ERROR in ./node_modules/y-prosemirror/src/plugins/cursor-plugin.js
Module not found: Error: Can't resolve 'y-protocols/awareness.js' in '/home/mgielda/antmicro/github.com/mgielda/yjs-demos/prosemirror-dat/node_modules/y-prosemirror/src/plugins'
 @ ./node_modules/y-prosemirror/src/plugins/cursor-plugin.js 5:0-52
 @ ./node_modules/y-prosemirror/src/y-prosemirror.js
 @ ./prosemirror.js
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! yjs-demos-prosemirror-dat@1.0.0 dist: `webpack --mode=production`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the yjs-demos-prosemirror-dat@1.0.0 dist script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/mgielda/.npm/_logs/2020-05-02T22_29_37_555Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! yjs-demos-prosemirror-dat@1.0.0 postinstall: `npm run dist`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the yjs-demos-prosemirror-dat@1.0.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/mgielda/.npm/_logs/2020-05-02T22_29_37_644Z-debug.log

Also, looking at package.json I see that the HTML filename is wrong, i.e. it says prosemirror.html but the file in the example is prosemirror-dat.html. I assume the example is not being tested / is obsolete?

mgielda commented 4 years ago

Ah, I see, it's definitely not obsolete, on the contrary it's brand-new ;)

Anyhow, forgot to day - thank you so much for these demos, super helpful. So just trying to be helpful by letting you know this one does not work, probably something small...

dmonad commented 4 years ago

It's sometimes hard to keep all these projects in-sync. I fixed the filename issue. But I can't reproduce the other issue.

In a fresh clone of yjs-demos I did: cd prosemirror-dat && npm i && npm start

If this still doesn't work for you, can you please report the npm version and the node version?

gremloon commented 4 years ago

Hi, im having the same problem.

npm - 6.14.5 node - v12.18.1 Ubuntu 18.04

/root/.cache/node-gyp/12.18.1/include/node/v8.h:6126:46: note:   candidate expects 1 argument, 0 provided
utp.target.mk:121: recipe for target 'Release/obj.target/utp/src/socket_wrap.o' failed
make: *** [Release/obj.target/utp/src/socket_wrap.o] Error 1
make: Leaving directory '/home/jay/code/yjs-demos/prosemirror-dat/node_modules/utp-native/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/root/.nvm/versions/node/v12.18.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 4.19.104-microsoft-standard
gyp ERR! command "/root/.nvm/versions/node/v12.18.1/bin/node" "/root/.nvm/versions/node/v12.18.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/jay/code/yjs-demos/prosemirror-dat/node_modules/utp-native
gyp ERR! node -v v12.18.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
ERROR in ./node_modules/y-prosemirror/src/plugins/cursor-plugin.js
Module not found: Error: Can't resolve 'y-protocols/awareness.js' in '/home/jay/code/yjs-demos/prosemirror-dat/node_modules/y-prosemirror/src/plugins'
 @ ./node_modules/y-prosemirror/src/plugins/cursor-plugin.js 5:0-52
 @ ./node_modules/y-prosemirror/src/y-prosemirror.js
 @ ./prosemirror.js

Thank you.

dmonad commented 4 years ago

Hi @gremloon, I just installed node v12.18.1 with npm 6.14.5. Then I did the following.

git clone git@github.com:yjs/yjs-demos.git
cd yjs-demos/prosemirror-dat
npm i
npm start // working 🎉

And it is working for me. What am I doing differently?

I know it is painful to define exactly what you are doing. But I really can't debug this issue if I can't reproduce it. This is why the new Bug Forms now require you to fill out exactly what you are doing.

dmonad commented 4 years ago

I also get the first error message:

/root/.cache/node-gyp/12.18.1/include/node/v8.h:6126:46: note:   candidate expects 1 argument, 0 provided
utp.target.mk:121: recipe for target 'Release/obj.target/utp/src/socket_wrap.o' failed
make: *** [Release/obj.target/utp/src/socket_wrap.o] Error 1
make: Leaving directory '/home/jay/code/yjs-demos/prosemirror-dat/node_modules/utp-native/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/root/.nvm/versions/node/v12.18.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 4.19.104-microsoft-standard
gyp ERR! command "/root/.nvm/versions/node/v12.18.1/bin/node" "/root/.nvm/versions/node/v12.18.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/jay/code/yjs-demos/prosemirror-dat/node_modules/utp-native
gyp ERR! node -v v12.18.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok

This is normal. This is a problem with the native bindings for dat. Nothing that concerns Yjs.

I just can't reproduce the second error message.