Search code examples
meteorangularangular2-meteor

Failed to import { Match } from 'meteor/match';


I tried to use Match.ObjectIncluding in angular2-meteor1.3.1 project.

Based on this file meteor.d.ts, I can successful use

import { Meteor } from 'meteor/meteor';
import { Mongo } from 'meteor/mongo';

However, when I tried to use

import { Match } from 'meteor/match';

I got error:

/Users/hongbo-miao/.meteor/packages/meteor-tool/.1.3.1.z9fvfj++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:267
                        throw(ex);
                              ^
Error: Can't find npm module 'meteor/match'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?
    at Object.Npm.require (/test/.meteor/local/build/programs/server/boot.js:195:17)
    at options.fallback (packages/modules-runtime.js:413:18)
    at require (packages/modules-runtime.js:98:16)
    at meteorInstall.collections.methods.ts (collections/methods.ts:2:1)
    at fileEvaluate (packages/modules-runtime.js:158:9)
    at require (packages/modules-runtime.js:92:16)
    at /test/.meteor/local/build/programs/server/app/app.js:905:1
    at /test/.meteor/local/build/programs/server/boot.js:283:10
    at Array.forEach (native)
    at Function._.each._.forEach (/Users/hongbo-miao/.meteor/packages/meteor-tool/.1.3.1.z9fvfj++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)

How can I import Match correctly? Thanks


Solution

  • So it turns out the typings file is wrong. The new typings file is here, which uses

    'meteor/check'