y-websocket icon indicating copy to clipboard operation
y-websocket copied to clipboard

Why not add "type": "module" in package.json of y-websocket?

Open kapv89 opened this issue 3 years ago • 1 comments

Checklist

  • [x] Are you reporting a bug? Use github issues for bug reports and feature requests. For general questions, please use https://discuss.yjs.dev/
  • [x] Try to report your issue in the correct repository. Yjs consists of many modules. When in doubt, report it to https://github.com/yjs/yjs/issues/

Describe the bug As seen in this repo - https://github.com/kapv89/yjs-scalable-ws-backend/tree/external_api_persistence ... adding "type": "module" to package.json of y-websocket allows y-websocket to be used in node-environment for unit tests. Not sure why this is not done yet by default on this package.

To Reproduce Steps to reproduce the behavior:

  1. Clone https://github.com/kapv89/yjs-scalable-ws-backend/tree/external_api_persistence (the specific branch)
  2. Follow steps in Usage. See tests working fine
  3. In one run, don't follow step#5 in Usage, complete the steps and see the error caused by y-websocket lacking "type": "module"

Expected behavior It should be trivial to use y-websocket in tests of your y-crdt websocket-backend. It's not right now.

Environment Information

kapv89 avatar Nov 11 '22 15:11 kapv89

The server moved to yjs/y-websocket-server. It is a proper ESM module now with typings.

dmonad avatar Apr 02 '25 22:04 dmonad