Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meteor versions supported? #2

Open
hectoroso opened this issue Feb 17, 2022 · 5 comments
Open

Meteor versions supported? #2

hectoroso opened this issue Feb 17, 2022 · 5 comments

Comments

@hectoroso
Copy link

My company has been using Meteor 1.6 with numtel/meteor-mysql. One of the things that has kept us from upgrading Meteor is that the package doesn't work with newer versions of Meteor. A lot of articles have suggested Apollo/GraphQL, but while investigating whether there was a live query capability, I ran into this package.

Is this still being supported and is it compatible with newer versions of Meteor?

@vlasky
Copy link
Owner

vlasky commented Feb 17, 2022

Welcome @hectoroso! vlasky:mysql certainly is supported and is being used by many businesses in various Meteor production apps.

@hectoroso
Copy link
Author

Thanks @vlasky! I'm very excited to hear this.

To test it out I tried to update numtel's MySQL leaderboard example. I updated the calls to Meteor.publish() to include LiveMysqlKeySelector, and replaced MysqlSubscription with Meteor.subscribe()

players = new MysqlSubscription('allPlayers');
myScore = new MysqlSubscription('playerScore', 'Maxwell');

changed to

players = Meteor.subscribe('allPlayers');
myScore = Meteor.subscribe('playerScore', 'Maxwell');

I then ran:

meteor remove numtel:mysql
meteor add vlasky:mysql

However, running meteor fails with the following error, both with Meteor 1.6.1.4 and 2.6:

W20220218-15:24:32.212(-8)? (STDERR) /Users/hector/.meteor/packages/promise/.0.12.0.10hwnda.rld8++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/promise_server.js:218
W20220218-15:24:32.250(-8)? (STDERR)       throw error;
W20220218-15:24:32.250(-8)? (STDERR)       ^
W20220218-15:24:32.251(-8)? (STDERR) 
W20220218-15:24:32.251(-8)? (STDERR) TypeError: Meteor.subscribe is not a function
W20220218-15:24:32.251(-8)? (STDERR)     at module (leaderboard.js:12:18)
W20220218-15:24:32.251(-8)? (STDERR)     at fileEvaluate (packages/modules-runtime.js:336:7)
W20220218-15:24:32.251(-8)? (STDERR)     at Module.require (packages/modules-runtime.js:238:14)
W20220218-15:24:32.251(-8)? (STDERR)     at require (packages/modules-runtime.js:258:21)
W20220218-15:24:32.251(-8)? (STDERR)     at /Users/hector/Dev/meteor/leaderboard_mysql/.meteor/local/build/programs/server/app/app.js:172:1
W20220218-15:24:32.251(-8)? (STDERR)     at /Users/hector/Dev/meteor/leaderboard_mysql/.meteor/local/build/programs/server/boot.js:401:38
W20220218-15:24:32.252(-8)? (STDERR)     at Array.forEach (<anonymous>)
W20220218-15:24:32.252(-8)? (STDERR)     at /Users/hector/Dev/meteor/leaderboard_mysql/.meteor/local/build/programs/server/boot.js:226:21
W20220218-15:24:32.252(-8)? (STDERR)     at /Users/hector/Dev/meteor/leaderboard_mysql/.meteor/local/build/programs/server/boot.js:464:7
W20220218-15:24:32.252(-8)? (STDERR)     at Function.run (/Users/hector/Dev/meteor/leaderboard_mysql/.meteor/local/build/programs/server/profile.js:280:14)
W20220218-15:24:32.252(-8)? (STDERR)     at /Users/hector/Dev/meteor/leaderboard_mysql/.meteor/local/build/programs/server/boot.js:463:13

Did I make a mistake in how I used Meteor.subscribe()? Do you have any example code using this version of the package?

@vlasky
Copy link
Owner

vlasky commented Feb 21, 2022

@hectoroso Meteor.subscribe() is definitely the correct function to use on the client side, but that numtel MySQL leaderboard example code is old and needs a number of fixes to work with modern Meteor and the semantic changes in vlasky:mysql.

For instance, overcoming the error you are reporting above requires you to add the Meteor ecmascript and typescript packages to the project and then add this line to the top of leaderboard.js:

import { Meteor } from "meteor/meteor";

I just spent some time to poke around and I got the leaderboard example mostly working with vlasky:mysql and Meteor 2.6, but it needs more TLC to be suitable to use as teaching-quality code for newcomers. I am busy at the moment but I will revisit it.

If you really want, perhaps I can send you my current modified code privately.

@hectoroso
Copy link
Author

I did add that import, but not any additional packages. If you could send me what code you have that would be a great starting point, thanks! [email protected]

@hectoroso
Copy link
Author

Hi @vlasky, I'm just following up. Would it be possible for you to send me your current modified code? I'm a little stuck, and I'm thinking it's probably some configuration.

Also I noticed that you forked numtel's MySQL leaderboard example. Another option would be to push your changes up there, with a note in the Readme saying it's a work in progress. Whatever is easiest for you.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants