mizzao / meteor-sharejs

Meteor smart package for transparently adding ShareJS editors to an app
MIT License
225 stars 53 forks source link

ShareJS not defined in Meteor 1.6 #95

Open iwojapa opened 6 years ago

iwojapa commented 6 years ago

I get the following error when I try to use ShareJS in Meteor 1.6.

W20171204-11:23:01.111(-8)? (STDERR) /Users/iwojtowicz/.meteor/packages/meteor-tool/.1.6.0.18n9mub++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
W20171204-11:23:01.112(-8)? (STDERR)                        throw(ex);
W20171204-11:23:01.112(-8)? (STDERR)                        ^
W20171204-11:23:01.112(-8)? (STDERR) 
W20171204-11:23:01.112(-8)? (STDERR) ReferenceError: ShareJS is not defined
W20171204-11:23:01.112(-8)? (STDERR)     at sharejs-server.js (packages/mizzao:sharejs/sharejs-server.js:8:24)
W20171204-11:23:01.113(-8)? (STDERR)     at fileEvaluate (packages/modules-runtime.js:343:9)
W20171204-11:23:01.113(-8)? (STDERR)     at require (packages/modules-runtime.js:238:16)
W20171204-11:23:01.113(-8)? (STDERR)     at /Users/iwojtowicz/Documents/Projects/Misc/Design Cards/Source Code/.meteor/local/build/programs/server/packages/mizzao_sharejs.js:126:15
W20171204-11:23:01.113(-8)? (STDERR)     at /Users/iwojtowicz/Documents/Projects/Misc/Design Cards/Source Code/.meteor/local/build/programs/server/packages/mizzao_sharejs.js:132:3
W20171204-11:23:01.114(-8)? (STDERR)     at infos.forEach.info (/Users/iwojtowicz/Documents/Projects/Misc/Design Cards/Source Code/.meteor/local/build/programs/server/boot.js:414:13)
W20171204-11:23:01.114(-8)? (STDERR)     at Array.forEach (<anonymous>)
W20171204-11:23:01.114(-8)? (STDERR)     at /Users/iwojtowicz/Documents/Projects/Misc/Design Cards/Source Code/.meteor/local/build/programs/server/boot.js:413:9
W20171204-11:23:01.114(-8)? (STDERR)     at /Users/iwojtowicz/Documents/Projects/Misc/Design Cards/Source Code/.meteor/local/build/programs/server/boot.js:463:5
W20171204-11:23:01.114(-8)? (STDERR)     at Function.run (/Users/iwojtowicz/Documents/Projects/Misc/Design Cards/Source Code/.meteor/local/build/programs/server/profile.js:510:12)

I installed it with meteor add mizzao:sharejs

The demo app from the repo works fine, but breaks if I run meteor update.

edemaine commented 6 years ago

You just need to add a line of JavaScript:

import { ShareJS } from 'meteor/mizzao:sharejs'
ghost commented 6 years ago

I'm getting the same error. That line doesn't fix it either.

edemaine commented 6 years ago

Where did you add it? You need to make sure it's getting executed before ShareJS gets used. Do you get a different error?

I haven't tried the demo in a while, but I can confirm that this package works (in my own project) with Meteor 1.6.

ghost commented 6 years ago

I added it to the packages and I haven't added it to any templates. It's the same error.

W20171215-12:26:26.527(-8)? (STDERR) /home/.meteor/packages/meteor-tool/.1.6.0_1.ff6ofd.xp1u++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280 W20171215-12:26:26.529(-8)? (STDERR) throw(ex); W20171215-12:26:26.529(-8)? (STDERR) ^ W20171215-12:26:26.530(-8)? (STDERR) W20171215-12:26:26.530(-8)? (STDERR) ReferenceError: ShareJS is not defined W20171215-12:26:26.531(-8)? (STDERR) at sharejs-server.js (packages/mizzao:sharejs/sharejs-server.js:8:24) W20171215-12:26:26.531(-8)? (STDERR) at fileEvaluate (packages/modules-runtime.js:343:9) W20171215-12:26:26.532(-8)? (STDERR) at require (packages/modules-runtime.js:238:16) W20171215-12:26:26.533(-8)? (STDERR) at /media/files/application/election/.meteor/local/build/programs/server/packages/mizzao_sharejs.js:126:15 W20171215-12:26:26.533(-8)? (STDERR) at /media/files/application/election/.meteor/local/build/programs/server/packages/mizzao_sharejs.js:132:3 W20171215-12:26:26.534(-8)? (STDERR) at infos.forEach.info (/media/files/application/election/.meteor/local/build/programs/server/boot.js:414:13) W20171215-12:26:26.534(-8)? (STDERR) at Array.forEach (<anonymous>) W20171215-12:26:26.535(-8)? (STDERR) at /media/files/application/election/.meteor/local/build/programs/server/boot.js:413:9 W20171215-12:26:26.536(-8)? (STDERR) at /media/files/application/election/.meteor/local/build/programs/server/boot.js:463:5 W20171215-12:26:26.536(-8)? (STDERR) at Function.run (/media/files/application/election/.meteor/local/build/programs/server/profile.js:510:12)

edemaine commented 6 years ago

Oops, sorry, I'm mixing up version upgrades. You're right, this is broken. PR #94 fixes this issue. You can also replace package mizzao:sharejs with edemaine:sharejs in the meanwhile (which also includes PR #93).

iwoj commented 6 years ago

That's what I ended up doing to get this working.

Nice work on the time traveller conference, by the way. Legendary.

edemaine commented 6 years ago

@iwoj Did you attend the time traveler convention recently? ;-) It was awesome participating!

iwoj commented 6 years ago

I go back from time to time.

evanoralph commented 6 years ago

is this being fix ?

filston2006 commented 6 years ago

Great! I removed mizzao:sharejs and used edemaine:sharejs, now it works!