y-websockets-client icon indicating copy to clipboard operation
y-websockets-client copied to clipboard

Cannot read property 'typeDefinition' of undefined

Open aphelionz opened this issue 8 years ago • 2 comments

Hi there, getting the following error when running the tutorial.

The console error:

Database.js:576 

Uncaught TypeError: Cannot read property 'typeDefinition' of undefined
    at t.<anonymous> (https://tallylab-aphelionz.c9users.io/app/bower_components/yjs/y.js:8:8205)
    at i (https://tallylab-aphelionz.c9users.io/app/bower_components/yjs/y.js:7:7545)
    at Generator._invoke (https://tallylab-aphelionz.c9users.io/app/bower_components/yjs/y.js:7:8947)
    at Generator.e.(anonymous function) [as next] (https://tallylab-aphelionz.c9users.io/app/bower_components/yjs/y.js:7:7724)
    at i (https://tallylab-aphelionz.c9users.io/app/bower_components/yjs/y.js:7:7545)
    at Generator._invoke (https://tallylab-aphelionz.c9users.io/app/bower_components/yjs/y.js:7:8586)
    at Generator.e.(anonymous function) [as next] (https://tallylab-aphelionz.c9users.io/app/bower_components/yjs/y.js:7:7724)
    at i (https://tallylab-aphelionz.c9users.io/app/bower_components/yjs/y.js:7:7545)
    at Generator._invoke (https://tallylab-aphelionz.c9users.io/app/bower_components/yjs/y.js:7:8586)
    at Generator.e.(anonymous function) [as next] (https://tallylab-aphelionz.c9users.io/app/bower_components/yjs/y.js:7:7724)

My bower.js

  "dependencies": {
    "y-js": "*",
    "y-webrtc": "^8.0.7",
    "y-memory": "^8.0.9",
    "y-map": "^10.1.3",
    "y-array": "^10.1.4",
    "y-websockets-client": "^8.0.16",
    "y-test": "^0.4.1"
  }

My initialization JavaScript:

    Y({
      db: {
        name: 'memory' // store the shared data in memory
      },
      connector: {
        name: 'websockets-client', // use the websockets connector
        room: 'my room'            // Instances connected to the same room share data
        // url: 'localhost:1234' // specify your own server destination
      },
      share: { // specify the shared content
        map: 'Map',    // y.share.map is of type Y.Map
        array: 'Array' // y.share.array is of type Y.Array
      },
      sourceDir: '/app/bower_components' // where the modules are (browser only)
    }).then(function (y) {
      /*
        At this point Yjs is successfully initialized.
        Try it out in your browser console!
      */
      window.y = y
      console.log('Yjs instance ready!')
      y.share.map // is an Y.Map instance
      y.share.array // is an Y.Array instance
    })

aphelionz avatar Dec 31 '17 17:12 aphelionz

This looks pretty pretty dangerous, considering that we have an incompatible beta release running too.

"y-js": "*",

Can you check which version is actually installed?

dmonad avatar Mar 06 '18 03:03 dmonad

And I'm really sorry for the late answer .. I didn't see the issue and just stumbled on it..

dmonad avatar Mar 06 '18 03:03 dmonad