Closed optilude closed 8 years ago
This is the offending code in lib/modules.import.js
:
Meteor.setInterval(function() {
let now = new Date();
AnalysisCache.remove({ "expires": { $lte: now } });
}, 1000 * 60 * (Meteor.settings.clearCacheInterval || 5));
This was modelled on some similar cache-expiry code in Meteor itself.
If I move it to a Meteor.startup()
block, then the error goes away. I think that's a workable solution, but I'm not sure if I'm doing something wrong to require it?
Yes there were some problems with code from modules not running inside fibers but I had some problems reproducing it. I will take a look at this again.
Maybe we should run all code from System.register
inside Meteor.bindEnvironment
but I'm not sure if this won't introduce some unexpected behavior.
Meteor.startup
is wrapping code inside fiber again, thats why it works, but this kind of hack shouldn't be required for modules to work properly.
@MacRusher Any progress on this bug? In my case, the error occurs only when I run with --production. The offending line in lib/models.js is just export let Watchers = new Mongo.Collection('watchers')
. I can't see a work-around for this statement. I can't wrap an export statement.
Yeah we have some problems with this from time to time but using Universe Collection instead of normal collections works for some reason.
Of course this shouldn't happen, but this error is really not caused by modules but by way that promises are handled on server side in general (but polyfill is provided by our package so it is our fault)
But I have some good news! In Meteor 1.2 there will be a meteor-aware Promise polyfill that will make this problem go away once and for all :) So I just need to ask you for some patience.
Was this bug resolved with Meteor 1.2?
@dalgard yes, it's already fixed in upcoming version 0.5.
It's still work in progress but for now you can check branch meteor-1.2
or get it from atmosphere 0.5.0-beta
(there are known bugs in this release)
But fibers are working like a charm thanks to MDG promise polyfill :)
This should go away with new 0.5.0 version. Keep in mind that there are some braking changes in this release.
Hi,
Since upgrading to 0.4.1 (I'm not sure if the error was there before as a few other things changed at the same time) I'm getting this error on startup:
The file
server/main.js
contains:server/startup.import.js
in turn contains various imports and a block wrapped inMeteor.startup(...)
. One of the imports islib/models.import.js
where the error is originating.What is the right way to "bootstrap" server-side?