yjs / y-websocket

Websocket Connector for Yjs
https://docs.yjs.dev/ecosystem/connection-provider/y-websocket
MIT License
524 stars 262 forks source link

Cannot resolve dependency 'yjs/provider/websocket.js' #4

Closed crapthings closed 5 years ago

crapthings commented 5 years ago

import { WebsocketProvider } from 'yjs/provider/websocket.js'

image

i've cloned this module, and copy the code from readme, but it seems there's no yjs/provider

crapthings commented 5 years ago

if i use cloned module import { WebsocketProvider } from '../../../y-websocket'

y-websocket.js:167 Uncaught TypeError: Class constructor Observable cannot be invoked without 'new'
    at new WebsocketProvider (y-websocket.js:167)
    at index.js:13
dmonad commented 5 years ago

Correct. There is no yjs/provider. Where did you find this?

import { WebsocketProvider } from 'yjs/provider/websocket.js'

It definitely is not in the readme https://github.com/y-js/yjs/blob/master/README.v13.md

For the most up-to-date versions you can also look at https://github.com/y-js/yjs-demos

crapthings commented 5 years ago

image

because i cant install y-websocket, maybe its my npm issue.

i will try on other mac thanks