y-websocket
y-websocket copied to clipboard
Why not add "type": "module" in package.json of y-websocket?
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:
- Clone https://github.com/kapv89/yjs-scalable-ws-backend/tree/external_api_persistence (the specific branch)
- Follow steps in Usage. See tests working fine
- In one run, don't follow step#5 in Usage, complete the steps and see the error caused by
y-websocketlacking"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
- Node.js [email protected] /Users/kv/Projects/ref/yjs-scalable-ws-backend ├─┬ [email protected] │ ├─┬ [email protected] │ │ └── [email protected] deduped │ └── [email protected] deduped └── [email protected]
The server moved to yjs/y-websocket-server. It is a proper ESM module now with typings.