angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Errors in sublime text 3 after fresh installation, though it runs smoothly on `ng serve`.

Open chozzz opened this issue 10 years ago • 7 comments

Linux Ubuntu 14.04

ng --version angular-cli: 1.0.0-beta.11-webpack.2 node: 6.4.0 os: linux x64

node --version v6.4.0

Repro steps.

ng new project_name cd project_name npm install // No errors with the installation, some warnings thou // Browse the project with Sublime Text 3.0 // Open TypeScript: Show Error List (All the texts are underlined with reds)

The log given by the failure.

/home/myusername/dev/my_project/node_modules/@angular/platform-browser/src/web_workers/shared/service_message_broker.d.ts [1 errors]
    (35, 84) Cannot find name 'Promise'.
/home/myusername/dev/my_project/node_modules/@angular/core/src/facade/lang.d.ts [3 errors]
    (11, 17) Cannot find name 'Map'.
    (12, 17) Cannot find name 'Set'.
    (67, 59) Cannot find name 'Map'.
/home/myusername/dev/my_project/node_modules/@angular/core/src/facade/collection.d.ts [13 errors]
    (1, 25) Cannot find name 'MapConstructor'.
    (2, 25) Cannot find name 'SetConstructor'.
    (4, 27) Cannot find name 'Map'.
    (4, 39) Cannot find name 'Map'.
    (7, 9) Cannot find name 'Map'.
    (8, 30) Cannot find name 'Map'.
    (11, 43) Cannot find name 'Map'.
    (12, 27) Cannot find name 'Map'.
    (14, 23) Cannot find name 'Map'.
    (15, 25) Cannot find name 'Map'.
    (100, 41) Cannot find name 'Set'.
    (101, 22) Cannot find name 'Set'.
    (102, 25) Cannot find name 'Set'.
/home/myusername/dev/my_project/node_modules/@angular/core/src/linker/ng_module_factory_loader.d.ts [1 errors]
    (14, 34) Cannot find name 'Promise'.
/home/myusername/dev/my_project/node_modules/@angular/common/src/facade/lang.d.ts [3 errors]
    (11, 17) Cannot find name 'Map'.
    (12, 17) Cannot find name 'Set'.
    (67, 59) Cannot find name 'Map'.
/home/myusername/dev/my_project/node_modules/@angular/platform-browser-dynamic/index.d.ts [3 errors]
    (98, 104) Cannot find name 'Promise'.
    (104, 99) Cannot find name 'Promise'.
    (118, 113) Cannot find name 'Promise'.
/home/myusername/dev/my_project/node_modules/@angular/core/src/di/reflective_provider.d.ts [2 errors]
    (108, 123) Cannot find name 'Map'.
    (108, 165) Cannot find name 'Map'.
/home/myusername/dev/my_project/src/main.ts [1 errors]
    (1, 1) File '/home/myusername/dev/my_project/node_modules/angular2/typings/browser.d.ts' not found.
/home/myusername/dev/my_project/node_modules/@angular/platform-browser/src/dom/dom_renderer.d.ts [1 errors]
    (18, 37) Cannot find name 'Map'.
/home/myusername/dev/my_project/src/app/app.module.ts [1 errors]
    (20, 14) Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.
/home/myusername/dev/my_project/node_modules/@angular/common/src/directives/ng_class.d.ts [1 errors]
    (81, 34) Cannot find name 'Set'.
/home/myusername/dev/my_project/node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts [2 errors]
    (24, 15) Cannot find name 'Map'.
    (28, 16) Cannot find name 'Map'.
/home/myusername/dev/my_project/src/app/app.component.ts [1 errors]
    (9, 14) Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.
/home/myusername/dev/my_project/node_modules/@angular/core/src/linker/component_resolver.d.ts [1 errors]
    (22, 58) Cannot find name 'Promise'.
/home/myusername/dev/my_project/node_modules/@angular/platform-browser/src/facade/collection.d.ts [13 errors]
    (1, 25) Cannot find name 'MapConstructor'.
    (2, 25) Cannot find name 'SetConstructor'.
    (4, 27) Cannot find name 'Map'.
    (4, 39) Cannot find name 'Map'.
    (7, 9) Cannot find name 'Map'.
    (8, 30) Cannot find name 'Map'.
    (11, 43) Cannot find name 'Map'.
    (12, 27) Cannot find name 'Map'.
    (14, 23) Cannot find name 'Map'.
    (15, 25) Cannot find name 'Map'.
    (100, 41) Cannot find name 'Set'.
    (101, 22) Cannot find name 'Set'.
    (102, 25) Cannot find name 'Set'.
/home/myusername/dev/my_project/node_modules/@angular/platform-browser-dynamic/src/facade/lang.d.ts [3 errors]
    (11, 17) Cannot find name 'Map'.
    (12, 17) Cannot find name 'Set'.
    (67, 59) Cannot find name 'Map'.
/home/myusername/dev/my_project/node_modules/@angular/platform-browser/src/web_workers/shared/client_message_broker.d.ts [2 errors]
    (32, 65) Cannot find name 'Promise'.
    (40, 56) Cannot find name 'Promise'.
/home/myusername/dev/my_project/node_modules/@angular/common/src/pipes/async_pipe.d.ts [1 errors]
    (41, 38) Cannot find name 'Promise'.
/home/myusername/dev/my_project/node_modules/@angular/core/src/application_ref.d.ts [7 errors]
    (99, 88) Cannot find name 'Promise'.
    (134, 67) Cannot find name 'Promise'.
    (150, 109) Cannot find name 'Promise'.
    (202, 67) Cannot find name 'Promise'.
    (204, 109) Cannot find name 'Promise'.
    (236, 42) Cannot find name 'Promise'.
    (331, 33) Cannot find name 'Promise'.
/home/myusername/dev/my_project/node_modules/@angular/core/src/linker/systemjs_component_resolver.d.ts [2 errors]
    (23, 53) Cannot find name 'Promise'.
    (36, 53) Cannot find name 'Promise'.
/home/myusername/dev/my_project/node_modules/@angular/core/src/application_init.d.ts [1 errors]
    (16, 18) Cannot find name 'Promise'.
/home/myusername/dev/my_project/node_modules/@angular/core/src/linker/dynamic_component_loader.d.ts [4 errors]
    (67, 148) Cannot find name 'Promise'.
    (108, 144) Cannot find name 'Promise'.
    (113, 139) Cannot find name 'Promise'.
    (114, 135) Cannot find name 'Promise'.
/home/myusername/dev/my_project/node_modules/@angular/core/src/linker/compiler.d.ts [3 errors]
    (47, 76) Cannot find name 'Promise'.
    (62, 57) Cannot find name 'Promise'.
    (70, 73) Cannot find name 'Promise'.
/home/myusername/dev/my_project/node_modules/@angular/platform-browser/src/web_workers/worker/location_providers.d.ts [1 errors]
    (21, 86) Cannot find name 'Promise'.
/home/myusername/dev/my_project/node_modules/@angular/platform-browser/src/facade/lang.d.ts [3 errors]
    (11, 17) Cannot find name 'Map'.
    (12, 17) Cannot find name 'Set'.
    (67, 59) Cannot find name 'Map'.
/home/myusername/dev/my_project/node_modules/@angular/platform-browser/src/dom/dom_adapter.d.ts [1 errors]
    (96, 42) Cannot find name 'Map'.
/home/myusername/dev/my_project/node_modules/@angular/core/src/linker/system_js_ng_module_factory_loader.d.ts [1 errors]
    (11, 25) Cannot find name 'Promise'.
/home/myusername/dev/my_project/node_modules/rxjs/Observable.d.ts [3 errors]
    (10, 66) Cannot find name 'Promise'.
    (66, 60) Cannot find name 'Promise'.
    (66, 70) Cannot find name 'Promise'.

chozzz avatar Aug 29 '16 05:08 chozzz

Check this out: https://github.com/Microsoft/TypeScript-Sublime-Plugin/issues/470#issuecomment-243162816

This resolved my Sublime 3 typescript issues

radoslavpetranov avatar Aug 29 '16 15:08 radoslavpetranov

fyi, getting similar errors also using VS Code, so I'm wondering if it's something with the generated project

victormejia avatar Aug 29 '16 17:08 victormejia

@radoslavpetranov This error message actually comes from that TypeScript error log from the plugin that you referenced. Here's the detailed screenshot.

sublime_typescript_issue

chozzz avatar Aug 30 '16 01:08 chozzz

So didn't the solution in that link I sent work for you? It seems it worked for all other people complaining about the same issue.

radoslavpetranov avatar Aug 30 '16 06:08 radoslavpetranov

@radoslavpetranov So far, no lucks with your solution. I've tried reinstalling it as well. I can still develop and ignore the errors, but its just pain in the eyes.. Any other clues?

chozzz avatar Aug 30 '16 06:08 chozzz

The issue is that the plugin you use in sublime to support Typescript doesn't seem to support TS2.0.

CLI generated projects use [email protected] and make use of the lib and typeRoots properties available in TS2.0. That unfortunately makes the tsconfig.json invalid for TS1.8.

I can't speak for sublime, but I know VSCode has a way to configure which Typescript binary to use. If you can, configure Sublime 3 to use either the local [email protected] or a global one.

filipesilva avatar Sep 20 '16 23:09 filipesilva

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.