Meteor JS Uncaught ReferenceError: Session is not defined

Hello

I’ve this problem with meteor 1.4.n : “Meteor JS Uncaught ReferenceError: Session is not defined”

I’ve done “meteor add session” and there is no change. The message is still appearing.

Some one knows the solution ?

Thank you.

Pierre.

If you are using modules don’t forget to import session with: import { Session } from ‘meteor/session’;

Ok thank. I did It too.

Have you an other idea please ?

Thank you.

No other idea. If you have added session and imported it in each file you want to use it in then it should work. Maybe if you post your code it might help.

1 Like

Hello

I done It and it works .

Thank you.

Pierre

This issue can also occur if you import client files on the server by accident, and perhaps a Meteor.startup with some Session code within that.

For those who come across this later. I had this issue when testing, and client files with Meteor.startup got executed on the server. Easy fix is a Meteor.isClient && Meteor.startup ....