PatrickJS-starter icon indicating copy to clipboard operation
PatrickJS-starter copied to clipboard

TypeScript Errors

Open jshamley opened this issue 10 years ago • 7 comments

  • I'm submitting a ... [x] bug report
  • Do you want to request a feature or report a bug? Report a bug
  • What is the current behavior? Errors on npm run server
  • What is the expected behavior? Typings should be loaded.
  • Please tell us about your environment: Angular version: 2.0.0-rc5 Node v6.3.0 NPM v 3.10.3
  • Other information When I clone a fresh version of this repo and try to start it I get the below errors in the console. The app itself opens up ok and does not have any errors.

git clone --depth 1 https://github.com/angularclass/angular2-webpack-starter.git cd angular2-webpack-starter npm install npm run server or npm start

[default] Cannot find global type 'Array'. [default] Cannot find global type 'Boolean'. [default] Cannot find global type 'Function'. [default] Cannot find global type 'IArguments'. [default] Cannot find global type 'Number'. [default] Cannot find global type 'Object'. [default] Cannot find global type 'RegExp'. [default] Cannot find global type 'String'. [default] /starter/node_modules/@angular/common/src/directives/ng_class.d.ts:81:34 Cannot find name 'Set'. [default] /starter/node_modules/@angular/common/src/directives/ng_if.d.ts:37:77 Cannot find name 'Object'. [default] /starter/node_modules/@angular/common/src/directives/ng_plural.d.ts:78:54 Cannot find name 'Object'. [default] /starter/node_modules/@angular/common/src/directives/ng_switch.d.ts:12:80 Cannot find name 'Object'. [default] /starter/node_modules/@angular/common/src/directives/ng_switch.d.ts:93:75 Cannot find name 'Object'. [default] /starter/node_modules/@angular/common/src/directives/ng_switch.d.ts:106:75 Cannot find name 'Object'. [default] /starter/node_modules/@angular/common/src/directives/ng_template_outlet.d.ts:33:22 Cannot find name 'Object'. [default] /starter/node_modules/@angular/common/src/directives/ng_template_outlet.d.ts:34:35 Cannot find name 'Object'. [default] /starter/node_modules/@angular/common/src/facade/lang.d.ts:9:20 Cannot find name 'Object'. [default] /starter/node_modules/@angular/common/src/facade/lang.d.ts:10:19 Cannot find name 'Array'. [default] /starter/node_modules/@angular/common/src/facade/lang.d.ts:11:17 Cannot find name 'Map'. [default] /starter/src/custom-typings.d.ts:55:30 Cannot find name 'Promise'. [default] /starter/src/custom-typings.d.ts:66:42 Cannot find name 'Promise'. [default] /starter/src/custom-typings.d.ts:70:29 Cannot find name 'Promise'. [default] /starter/src/custom-typings.d.ts:74:32 Cannot find name 'Function'. [default] /starter/src/custom-typings.d.ts:81:30 Cannot find name 'Function'. [default] /starter/src/custom-typings.d.ts:94:46 Cannot find name 'Error'. [default] /starter/src/custom-typings.d.ts:95:44 Cannot find name 'Error'. [default] /starter/src/custom-typings.d.ts:104:34 A rest parameter must be of an array type. [default] /starter/src/custom-typings.d.ts:106:70 Cannot find name 'RegExp'. [default] /starter/src/main.browser.ts:17:25 Cannot find name 'Promise'. [default] /starter/src/polyfills.browser.ts:43:3 Cannot find name 'Error'. [default] /starter/src/polyfills.browser.ts:43:27 Cannot find name 'Infinity'. [default] Checking finished with 891 errors

jshamley avatar Aug 30 '16 18:08 jshamley

Seeing the same issue, on both windows and osx.

ghost avatar Aug 30 '16 18:08 ghost

Same here! I fixed it by setting "target": "es6", instead of es5 in tsconfig.json and downgrading to "awesome-typescript-loader": "^1.1.1". Not sure if this is the right way to fix it.

mohatt avatar Aug 30 '16 21:08 mohatt

Thanks for the tip @mdkholy - It would be nice to continue having TS compile to ES5 though.

jshamley avatar Aug 30 '16 22:08 jshamley

This issue has been fixed and pushed to the repo. Pulling the latest code and running npm start works as expected.

jshamley avatar Aug 31 '16 17:08 jshamley

@jshamley How was this issue solved? I'm getting it in my own projects as well, and I'm curious how to fix it.

mterwoord avatar Sep 14 '16 07:09 mterwoord

Just ran into this. The fix for me was to pin awesome-typescript-loader to 2.2.4 instead of ^2.2.1

tmakin avatar Nov 07 '16 09:11 tmakin

@tmakin I can't thank you enough. I've been tearing my hair out for days trying to fix this issue. Such a tiny changed solved everything! THANK YOU!

mydreamdoctor avatar Nov 16 '16 11:11 mydreamdoctor