Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Fix getting started wiki page (was: share js client can't find #153

raph-amiard opened this Issue · 8 comments

6 participants


Hi, i have tried to install share-js as per the procedure found in the wiki, with the same example code for the server and for the client. Here is the server code :

var connect = require('connect'),
sharejs = require('share').server;

var server = connect(
    connect.static(__dirname + '/public')
var options = {db: {type: 'none'}}; // See docs for options. {type: 'redis'} to enable persistance.

// Attach the sharejs REST and interfaces to the server
sharejs.attach(server, options);

server.listen(8000, function(){
    console.log('Server running at');

and here is the client code (html file) :

    <script src=""></script>
    <script src="/"></script>
    <script src="/channel/bcsocket.js"></script> 
    <script src="/share/share.js"></script>
    <script src="/share/ace.js"></script>

    <div id="editor"></div>
      var editor = ace.edit("editor");'hello', 'text', {host: 'localhost', port: 8000}, function(doc, error) {


It fails with the error : " : Failed to load resource: the server responded with a status of 404 (Not Found)"

@obijywk is disabled in ShareJS by default - I think you at least need to include a 'socketio' key in your ShareJS attach options to cause ShareJS to set it up.

Furthermore I think you might also have to make some additional call to tell to serve it's client library from "/" - I'm not familiar with so I'm not sure how or even if this needs to be done.



i don't necessarily want to use, i just want it to work. Even if you remove the line, it still fails with an error : "bcsocket.js:90Uncaught TypeError: Object # has no method 'match'".

Executing bin/example_server and accessing the client page gives the same error.

So i guess the question is , how do you make share js (any version) work ?


BrowserChannel is probably the easiest way to just get it working. Try using these options:
var options = {db: {type: 'none'}, browserChannel: {}};
and removing the script tag, and see if it works.

That still doesn't explain your error "bcsocket.js:90Uncaught TypeError: Object # has no method 'match'" though, I'm not sure what's causing that.


hi all, i was with @raph-amiard earlier when we experienced those issues but actually there is no issue, at least with the current version of sharejs/browserchannel there isn't.

thing is, we followed the code described in the wiki which seems outdated for it instructs to include the script on the client. that probably resulted in the 404 business.

so then we simply removed the script tag and we had issue #141 and yeh... that isn't really an issue

so, we just did what we probably should have done in the first place and used the code on the README page... and that works like a charm!

the issue should be renamed to 'wiki out of date'. sorry for the hassle and yeh, updating the wiki would be nice!
also @josephg, is that still the case??

ps: @daredevildave we tried this out also, but it seems like it doesn't work... thought i'd let you know.


@raph-amiard @athibaud feel free to edit the wiki, much obliged :-)


I have edited the wiki to remove the include. This issue can be closed.

@josephg josephg closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.