[Meteor 3.3.1] $geoIntersects inside publication throws error

I’m DYING from this bug, I can’t figure out why it’s happening. It didn’t happen on 3.3. It’s easy to recreate:

Sample Code:

Meteor.publish('Home', function(viewport) {
	check(viewport, Match.ObjectIncluding({bounds: geoPolygonSchema}));

	return Features.find({
		'hull': {$geoIntersects: {$geometry: viewport.bounds}},
	});
});

hull is a GeoJSON polygon

Result:

I20250808-14:47:44.133(-4)? Exception from sub Home id crkZKreZwmLFTG6ZY Error: Unrecognized operator: $geoIntersects
I20250808-14:47:44.134(-4)?     at packages/minimongo/common.js:1135:11
I20250808-14:47:44.134(-4)?     at Array.map (<anonymous>)
I20250808-14:47:44.134(-4)?     at operatorBranchedMatcher (packages/minimongo/common.js:1100:55)
I20250808-14:47:44.134(-4)?     at compileValueSelector (packages/minimongo/common.js:627:12)
I20250808-14:47:44.134(-4)?     at packages/minimongo/common.js:602:26
I20250808-14:47:44.134(-4)?     at Array.map (<anonymous>)
I20250808-14:47:44.134(-4)?     at compileDocumentSelector (packages/minimongo/common.js:573:48)
I20250808-14:47:44.134(-4)?     at packages/minimongo/common.js:561:12
I20250808-14:47:44.134(-4)?     at Array.map (<anonymous>)
I20250808-14:47:44.134(-4)?     at compileArrayOfDocumentSelectors (packages/minimongo/common.js:556:20)
I20250808-14:47:44.134(-4)?     at Object.$or (packages/minimongo/common.js:266:22)
I20250808-14:47:44.134(-4)?     at packages/minimongo/common.js:584:36
I20250808-14:47:44.135(-4)?     at Array.map (<anonymous>)
I20250808-14:47:44.135(-4)?     at compileDocumentSelector (packages/minimongo/common.js:573:48)
I20250808-14:47:44.135(-4)?     at Matcher._compileSelector (packages/minimongo/matcher.js:116:12)
I20250808-14:47:44.135(-4)?     at new Matcher (packages/minimongo/matcher.js:52:29)
1 Like

This could be related to something introduced in 3.3.1 indeed.

For the moment consider to downgrade to Meteor 3.3. Also, if you downgrade to Meteor 3.3, ensure to fix babel-compiler to 7.12.0 at .meteor/versions file, since 7.12.1 introduced a change by a mistake that requires 3.3.1 tool.

Thanks for the report :pray:, we will take care for 3.3.2.

1 Like