2

I'm just beginning to use Typescript in my meteor project. Everything has going well but there are some details that I can not easily correct. One of them is this: whenever I use the word Meteor (Meteor.call, Meteor.subscribe, ...) in my code the compiler complains by saying:

typescript Cannot find name 'Meteor'.

I'm using Atom, with typescript package, and it seems to accept Meteor perfectly.

Of course the message seems to be a warning because the compilation does not stop there and the building process completes, but the message is very annoying.

I installed the Meteor type definitions and can see there is a file in node_modules:

@types/meteor/meteor.d.ts

shouldn't the symbol Meteor be defined there?

It seems I'm missing something here, but can't figure out what.

Many thanks for your help and bye ...

2 Answers 2

2

Adding an import statement fixes the error:

import { Meteor } from 'meteor/meteor'

// ...

But that introduces another error. Cannot find module 'meteor/meteor'., which according to https://github.com/TypeStrong/atom-typescript/issues/1307 is not fixed yet.

Sign up to request clarification or add additional context in comments.

Comments

0

Try to install into Package.json

meteor npm install @types/meteor --save

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.