You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @copleykj , I'm trying to migrate from mizzao:user-status to this package due to a issue in the another package, however, I can't run my meteor app because appears this error:
W20201111-17:45:48.661(-6)? (STDERR) /Users/diavrank/.meteor/packages/meteor-tool/.1.11.1.95af9c.g0b4t++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
W20201111-17:45:48.683(-6)? (STDERR) throw(ex);
W20201111-17:45:48.683(-6)? (STDERR) ^
W20201111-17:45:48.683(-6)? (STDERR)
W20201111-17:45:48.683(-6)? (STDERR) TypeError: Cannot read property 'RegEx' of undefined
W20201111-17:45:48.683(-6)? (STDERR) at module (packages/socialize:linkable-model/common/linkable-model.js:50:28)
W20201111-17:45:48.683(-6)? (STDERR) at fileEvaluate (packages/modules-runtime.js:336:7)
W20201111-17:45:48.684(-6)? (STDERR) at Module.require (packages/modules-runtime.js:238:14)
W20201111-17:45:48.684(-6)? (STDERR) at Module.moduleLink [as link] (/Users/diavrank/.meteor/packages/modules/.0.15.0.tjvg00.6lcb++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/reify/lib/runtime/index.js:52:22)
W20201111-17:45:48.684(-6)? (STDERR) at module (packages/socialize:linkable-model/common/common.js:1:8)
W20201111-17:45:48.684(-6)? (STDERR) at fileEvaluate (packages/modules-runtime.js:336:7)
W20201111-17:45:48.684(-6)? (STDERR) at Module.require (packages/modules-runtime.js:238:14)
W20201111-17:45:48.684(-6)? (STDERR) at require (packages/modules-runtime.js:258:21)
W20201111-17:45:48.684(-6)? (STDERR) at /Users/diavrank/Documents/monitoreo-sismos/.meteor/local/build/programs/server/packages/socialize_linkable-model.js:149:15
W20201111-17:45:48.684(-6)? (STDERR) at /Users/diavrank/Documents/monitoreo-sismos/.meteor/local/build/programs/server/packages/socialize_linkable-model.js:154:3
W20201111-17:45:48.685(-6)? (STDERR) at /Users/diavrank/Documents/monitoreo-sismos/.meteor/local/build/programs/server/boot.js:401:38
W20201111-17:45:48.685(-6)? (STDERR) at Array.forEach (<anonymous>)
W20201111-17:45:48.685(-6)? (STDERR) at /Users/diavrank/Documents/monitoreo-sismos/.meteor/local/build/programs/server/boot.js:226:21
W20201111-17:45:48.685(-6)? (STDERR) at /Users/diavrank/Documents/monitoreo-sismos/.meteor/local/build/programs/server/boot.js:464:7
W20201111-17:45:48.685(-6)? (STDERR) at Function.run (/Users/diavrank/Documents/monitoreo-sismos/.meteor/local/build/programs/server/profile.js:280:14)
W20201111-17:45:48.685(-6)? (STDERR) at /Users/diavrank/Documents/monitoreo-sismos/.meteor/local/build/programs/server/boot.js:463:13
My code is the following:
import { Meteor } from 'meteor/meteor';
import { User } from 'meteor/socialize:user-model';
import { UserPresence } from 'meteor/socialize:user-presence';
import Utilities from '../../startup/server/Utilities';
import SimpleSchema from 'simpl-schema';
// Schema for the fields where we will store the status data
const StatusSchema = new SimpleSchema({
status: Object,
'status.online': { type: Boolean },
'status.idle': { type: Boolean, optional: true },
'status.lastLogin': Object
});
// Add the schema to the existing schema currently attached to the User model
User.attachSchema(StatusSchema);
// If `sessionIds` is undefined this signifies we need a fresh start.
// When a full cleanup is necessary we will unset the status field to show all users as offline
UserPresence.onCleanup(function onCleanup(sessionIds) {
if (!sessionIds) {
console.log('cleanup sessionIds executed');
Meteor.users.update({}, { $set: { 'status.online': false }, $unset: { 'status.idle': true } }, { multi: true });
}
});
// When a user comes online we set their status to online and set the lastOnline field to the current time
UserPresence.onUserOnline(function onUserOnline(userId, connection) {
console.log('connection: ', connection);
Meteor.users.update(userId, { $set: { 'status.online': true, 'lastLogin.date': Utilities.currentLocalDate() } });
});
// When a user goes idle we'll set their status to indicate this
UserPresence.onUserIdle(function onUserIdle(userId) {
Meteor.users.update(userId, { $set: { 'status.idle': false } });
});
// When a user goes offline we'll unset their status field to indicate offline status
UserPresence.onUserOffline(function onUserOffline(userId) {
Meteor.users.update(userId, { $set: { 'status.online': false }, $unset: { 'status.idle': true } });
});
I already added the necessary packages and it doesn't work :( .
Meteor packages:
socialize:user-presence
aldeed:simple-schema
Yarn dependency:
simpl-schema
(I also tried it with npm but neither work)
Do you know what could be the problem?
The text was updated successfully, but these errors were encountered:
I think I already found what the error was. I had installed the babrahams:transactions package and I realized that linkeable-model package was using:
import { SimpleSchema } from 'meteor/aldeed:simple-schema';// the correct form to import it is without destructuring, that's why it was undefined.
The socialize-linkeable-model package was in version 1.0.0
So, when I removed babrahams:transactions package, socialize-linkeable-model package was updated to 1.0.5 and I realized that in this version only uses the simpl-schema from package.json and it doesn't necessary to install aldeed:simple-schema from meteor command.
Conclusion:
When I imported your package (linkeable-model) into my app project (inside packages folder), I realized that it shows an error of incompatible packages between babrahams:[email protected] and [email protected] . Luckily I wasn't using transactions with that package, so I could remove it without problems.
Awesome, glad to hear you got this figured out. If you need any further help, don't hesitate to contact me through the meteor community slack, or even email if that works better.
Hi @copleykj , I'm trying to migrate from mizzao:user-status to this package due to a issue in the another package, however, I can't run my meteor app because appears this error:
My code is the following:
I already added the necessary packages and it doesn't work :( .
Meteor packages:
Yarn dependency:
(I also tried it with npm but neither work)
Do you know what could be the problem?
The text was updated successfully, but these errors were encountered: