Meteor JS Uncaught ReferenceError: Session is not defined


#1

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.


#2

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


#3

Ok thank. I did It too.

Have you an other idea please ?

Thank you.


#4

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.


#5

Hello

I done It and it works .

Thank you.

Pierre


#6

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 ....