Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 2 RC.5 & VS 2015: Cannot find name 'module', 'Set', 'Map', 'MapConstructor', 'SetConstructor'

The issue that I'm having is in the title. Everything that I've read says that it's a typings issue, but I haven't been able to track it down yet. It's a pretty large project, so I'll only give a few example of my settings:

tsconfig.json

{
  "compileOnSave": true,
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false
  },
"exclude": ["node_modules", "typings"]
}

typings.json

{
  "globalDependencies": {
    "core-js": "registry:dt/core-js#0.0.0+20160602141332",
    "jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
    "node": "registry:dt/node#6.0.0+20160807145350"
  }
}

package.json

{
  "name": "angular2-quickstart",
  "version": "1.0.0",
  "scripts": {
    "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
    "lite": "lite-server",
    "postinstall": "typings install",
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "typings": "typings"
  },
  "license": "ISC",
  "dependencies": {
    "@angular/common": "2.0.0-rc.5",
    "@angular/compiler": "2.0.0-rc.5",
    "@angular/core": "2.0.0-rc.5",
    "@angular/compiler-cli": "0.5.0",
    "@angular/forms": "0.3.0",
    "@angular/http": "2.0.0-rc.5",
    "@angular/platform-browser": "2.0.0-rc.5",
    "@angular/platform-browser-dynamic": "2.0.0-rc.5",
    "@angular/router": "3.0.0-rc.1",
    "@angular/router-deprecated": "2.0.0-rc.2",
    "@angular/upgrade": "2.0.0-rc.5",
    "angular2-in-memory-web-api": "0.0.17",
    "bootstrap": "^3.3.6",
    "core-js": "^2.4.0",
    "reflect-metadata": "^0.1.3",
    "rxjs": "5.0.0-beta.6",
    "systemjs": "0.19.27",
    "zone.js": "^0.6.12"
  },
  "devDependencies": {
    "concurrently": "^2.0.0",
    "lite-server": "^2.2.0",
    "typescript": "^1.8.10",
    "typings":"^1.3.3"
  }
}

Things I have tried:

  1. Referencing typings files directly in my app's entrypoint
  2. Changing compilerOptions -> target to es6/es2015
  3. Uninstalling and reinstalling the typings references in the root
  4. Updating the typings.json to the most up-to-date versions
  5. installing es6-shim and its typings

Any other suggestions would be much appreciated.

enter image description here

like image 484
ddpdoj Avatar asked Jun 14 '26 13:06

ddpdoj


1 Answers

Your package.json above has "typescript":"^1.8.10", but if you've updated to 2.0.2 in the last day or two it could be this bug with Typescript. If so, downgrading to an earlier version should fix it.

Your error messages look very similar to those reported in this issue on the angular-cli project.

like image 88
Mark Leong Avatar answered Jun 17 '26 02:06

Mark Leong



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!