Vaccano
Vaccano

Reputation: 82369

Does Typescript 1.8 need Reference Path declarations?

My project was compiling fine under 1.7 using the typescript project type (in visual studio 2015)

I installed 1.8 and now I get a whole bunch of cannot find name... and cannot find module ... errors.

For example I get Cannot find name 'breeze'.

But if I add this to the file:
/// <reference path="../../../scripts/typings/breeze/breeze.d.ts" />

Then they all go away... (well the breeze ones do)

But I did not need those to compile before I upgraded.

Does anyone understand what is going on here?

Upvotes: 2

Views: 228

Answers (2)

Schadensbegrenzer
Schadensbegrenzer

Reputation: 950

In case you are using Resharper 2016.1 (actual build 14.0.25123.0) you might want to clean up the breeze.d.ts file from some "noise" which breaks its intellisense.

In module "breeze.config" you see comments ontop of each function. These comments contain "@" symbol, which seem to be interpreted as valid decorator proposal. Remove the comments and you'll be fine.

Interestingly though, after I've removed the comments and saved the .d.ts file I was allowed to put back in the comments without Resharper complaining about it. So it seems to be a bug in Resharper.

Upvotes: 0

Mark Pieszak - Trilon.io
Mark Pieszak - Trilon.io

Reputation: 67021

What you need to do is look into typings.

https://github.com/typings/typings

You should be able to install breeze easily with it.

typings install breeze

Besides that, VS should be able to automatically see all your .d.ts DefinitelyTyped files, if not just make sure your tsconfig.json includes all /yourAppPath/*.ts files in its filesGlob array, that should take care of it as well.

Lastly, some IDEs recognize a _references.ts file, where you could include all your reference incudes /// <reference path="blah.d.ts" />

Upvotes: 1

Related Questions