Skip to content

Project generated with Angular-CLI showing errors under "node_modules" #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
probert94 opened this issue Jan 13, 2017 · 7 comments
Closed
Milestone

Comments

@probert94
Copy link
Contributor

I am currently trying out the typescript.java and the angular2-eclipse plugin (1.2.0 Snapshot).
I am using the global Angular-CLI installation (Version 1.0.0-beta.24), the embedded node.js (v4.2.4) as well as the embedded TypeScript Version (2.1.4).
When I generate a project using the Wizard (File->New->Other->Angular2 Project) and enable the TypeScript Builder, it gives me following errors:

tsc (TS2304): 'Cannot find name 'Map'.'	default_keyvalue_differ.d.ts	/XXX/node_modules/@angular/core/src/change_detection/differs	line 24	TypeScript Problem
tsc (TS2304): 'Cannot find name 'Map'.'	default_keyvalue_differ.d.ts	/XXX/node_modules/@angular/core/src/change_detection/differs	line 28	TypeScript Problem
tsc (TS2304): 'Cannot find name 'Map'.'	lang.d.ts	/XXX/node_modules/@angular/core/src/facade	line 12	TypeScript Problem
tsc (TS2304): 'Cannot find name 'Map'.'	reflective_provider.d.ts	/XXX/node_modules/@angular/core/src/di	line 88	TypeScript Problem
tsc (TS2304): 'Cannot find name 'Map'.'	reflective_provider.d.ts	/XXX/node_modules/@angular/core/src/di	line 88	TypeScript Problem
tsc (TS2304): 'Cannot find name 'Promise'.'	Observable.d.ts	/XXX/node_modules/rxjs	line 68	TypeScript Problem
tsc (TS2304): 'Cannot find name 'Promise'.'	Observable.d.ts	/XXX/node_modules/rxjs	line 68	TypeScript Problem
tsc (TS2304): 'Cannot find name 'Promise'.'	application_init.d.ts	/XXX/node_modules/@angular/core/src	line 16	TypeScript Problem
tsc (TS2304): 'Cannot find name 'Promise'.'	application_ref.d.ts	/XXX/node_modules/@angular/core/src	line 116	TypeScript Problem
tsc (TS2304): 'Cannot find name 'Promise'.'	application_ref.d.ts	/XXX/node_modules/@angular/core/src	line 132	TypeScript Problem
tsc (TS2304): 'Cannot find name 'Promise'.'	application_ref.d.ts	/XXX/node_modules/@angular/core/src	line 158	TypeScript Problem
tsc (TS2304): 'Cannot find name 'Promise'.'	application_ref.d.ts	/XXX/node_modules/@angular/core/src	line 160	TypeScript Problem
tsc (TS2304): 'Cannot find name 'Promise'.'	compiler.d.ts	/XXX/node_modules/@angular/core/src/linker	line 53	TypeScript Problem
tsc (TS2304): 'Cannot find name 'Promise'.'	compiler.d.ts	/XXX/node_modules/@angular/core/src/linker	line 61	TypeScript Problem
tsc (TS2304): 'Cannot find name 'Promise'.'	lang.d.ts	/XXX/node_modules/@angular/core/src/util	line 8	TypeScript Problem
tsc (TS2304): 'Cannot find name 'Promise'.'	ng_module_factory_loader.d.ts	/XXX/node_modules/@angular/core/src/linker	line 14	TypeScript Problem
tsc (TS2304): 'Cannot find name 'Promise'.'	system_js_ng_module_factory_loader.d.ts	/XXX/node_modules/@angular/core/src/linker	line 28	TypeScript Problem
tsc (TS2304): 'Cannot find name 'Set'.'	lang.d.ts	/XXX/node_modules/@angular/core/src/facade	line 13	TypeScript Problem

However, serving and building the app (using ng serve and ng build) works perfectly.
Even executing the "Compile TypeScript" on the "tsconfig.json" under "XXX/src" works perfectly and does not show any errors.
I even tryed deleting this errors, but they come back whenever I save changes on a .ts-File.

@angelozerr
Copy link
Owner

@Springrbua I'm improving TypeScritpt builder (to have more fast performance #109)

Could you share your project please.

@probert94
Copy link
Contributor Author

Thanks for the fast reply.
The project is basicly empty, just the default Angular-CLI-generated stuff.
The only thing I did was enable the "Compile on save"-Feature.

@probert94
Copy link
Contributor Author

Short update:
I noticed, that the number of errors shown in the Problems-View depends on the imports used in the saved file:

  • main.ts -> 46 Errors
  • app.module.ts -> 25 Errors
  • app.component.ts -> 18 Errors

The "app.component.spec.ts" shows 29 errors. Some of those errors are inside that file, saying that the methods "beforeEach", "describe", "expect" and "it" are not defined (Cannot find name "beforeEach").

Steps to reproduce:

  1. Create new Angular-CLI Project (using the wizard or "ng new"-command)
  2. Enable the TypeScript-Builder by opening the tsconfig.json and check the "Enable TypeScript Builder" Checkbox.
  3. Open one of the "*.ts"-Files and make a change (in my case it was "spaces to tabs"-Conversion)
  4. Save the changes

I am using the newest Snapshot Versions (typescript.java: 1.2.0.201701211655, Angular2 Eclipse: 1.1.0.201611012218), as well as Angular CLI Beta 26, NodeJS 7.3.0 (tryed with embedded Version 4.2.4 too) and embedded TypeScript Version 2.1.5.

@angelozerr
Copy link
Owner

@Springrbua if I understand well your problem is about "compile on save". Today compile on save is very basic: it execute "tsc" command for the given ts file which is saved. So I think you have trouble when there is some dependencies.

Please wait that I implement #109 which should improve compile on save.

@probert94
Copy link
Contributor Author

@angelozerr thanks again for your quick answer.
I guess you are right, that would explain, why running "tsc" in the source root (/src) completes without any errors.
So I guess you can close this, thanks

@angelozerr
Copy link
Owner

@Springrbua please retry this issue since now compile on save is done with tsserver

@probert94
Copy link
Contributor Author

@angelozerr seems to work fine right now, thanks.

@angelozerr angelozerr added this to the 1.2.0 milestone Feb 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants