Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Rx Operators Cannot Resolve Observable - Visual Studio 2015 & Typescript #1226

Open
ZenSoftware opened this issue May 7, 2016 · 3 comments

Comments

@ZenSoftware
Copy link

ZenSoftware commented May 7, 2016

There seems to be a problem with the node module resolutions with all the Rx operators in Visual Studio 2015. No matter what I try, I can not seem to get rid of these typescript errors. For example, when using the RxJS map operator within Angular2 Quickstart package, Visual Studio complains:

Severity: Error
Code: TS2664
Description: Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects
Project File: C:\Angular2-Quickstart\node_modules\rxjs\add\operator\map.d.ts
Line: 2

I have several other npm packages that my typescript project does not complain about. Just the RxJS operators. For some reason, when I browse to any type definition file under "node_modules\rxjs\add\operator" all of them are showing the above error on the line with
declare module '../../Observable' {

My project compiles fine using both the typescript's CLI and Visual Studio's built in compiler, but I am getting a flood of these errors in Visual Studio's error window. It also breaks Typescript's intellisense. I have attempted to include a reference path to Rx.KitchenSink. But I just get more of the same errors. Unfortunately nothing seems to be solving this issue.
/// <reference path="../node_modules/rxjs/Rx.KitchenSink.d.ts"/>

My tsconfig.json:

  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false
  }

My typings.json:

  "ambientDependencies": {
    "es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654"
    ...
  }

I am using the latest version of everything:
Windows 10
Visual Studio Enterprise 2015: Version 14.0.25123.00 Update 2
Typescript Version: 1.8.30.0
npm package: "rxjs": "5.0.0-beta.7" (Errors also occurs with 5.0.0-beta.6)
Node: v6.1.0 (I don't think it is relevant, but also occurs on a system with Node v5)

I have a second system with a similar setup, the errors also occur there.

@ghost
Copy link

ghost commented May 9, 2016

Guys same here!

just added import Rx from "rxjs/Rx"; and got >100 error messages
default

Microsoft Visual Studio Enterprise 2015
Version 14.0.25123.00 Update 2
Microsoft .NET Framework
Version 4.6.01038
ASP.NET and Web Tools 2015 (RC1 Update 1) 14.1.20203.0
ASP.NET and Web Tools 2015 (RC1 Update 1)

ASP.NET Web Frameworks and Tools 2012.2 4.1.41102.0

ASP.NET Web Frameworks and Tools 2013 5.2.40314.0

JavaScript Language Service 2.0
JavaScript Language Service

JavaScript Project System 2.0
JavaScript Project System

TypeScript 1.8.29.0
TypeScript tools for Visual Studio

@ZenSoftware
Copy link
Author

I'd like to hear from someone from the team if this RxJS related, or if this is a Typescript bug. I'm at a loss for where the root of the problem is.

@jmalonzo
Copy link
Contributor

jmalonzo commented May 9, 2016

@ZenSoftware @AloeDream Looks like you both are using rxjs v5 - you might be able to get more mileage by posting this to the rxjs 5 repo at https://github.com/reactivex/rxjs/issues.

Cheers.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants