1
votes

Here are the steps to reproduce the problem:

  1. mkdir and cd into it..
  2. npm init and accept the defaults
  3. jspm init.. accept defaults except don't use a transpiler
  4. jspm install aurelia-framework
  5. jspm install aurelia-bootstrapper
  6. Add an empty tsconfig.json file to the directory.. I've tried many tsconfig settings to fix this problem, but it works just the same with a simple { } configuration. I've even tried various mutations of https://github.com/aurelia/skeleton-navigation/blob/master/skeleton-typescript-asp.net5/src/skeleton-navigation-typescript-vs/tsconfig.json to no avail.
  7. tsc

At this point, you should stumble across the errors: jspm_packages/npm/[email protected]/aurelia-binding.d.ts(331,25): error TS2304: Cannot find name 'Map'. jspm_packages/npm/[email protected]/aurelia-binding.d.ts(353,49): error TS2304: Cannot find name 'Map'.

I'm guessing a dependency is missing?

In this repro, you'll also see some TS2304 errors in other aurelia*.d.ts files, but I'm not actually seeing those in my actual environment for some reason.

I've tried type adding the typings.json file from https://github.com/aurelia/skeleton-navigation/blob/master/skeleton-typescript-asp.net5/src/skeleton-navigation-typescript-vs/typings.json and then issued typings install, but that didn't change anything. Oddly enough, it didn't even help if I tried `typings install es6-promise --save'.

No matter what I try, I always get the same errors when I run tsc

For the record, I'm running the following versions...

  • npm v3.9.0
  • jspm v0.16.34
  • tsc v1.8.10

Any help is greatly appreciated.

1
Target ES6 in your tsconfig compiler options or add the d.ts files for ES6 collections - Jeremy Danyow
Just wanted to say "Hey Alex!" missed ya! - basarat
@JeremyDanyow for the win. - Alex Dresko
@basarat for the awesome. - Alex Dresko
Also, @JeremyDanyow, post an answer and I'll award it to you. Can you give any tips for what I might have binged to discover that answer on my own? I spent a fair amount of time trying to figure it out on my own, but it seems like your solution came so easily. I'm wondering if maybe I have a knowledge gap somewhere. - Alex Dresko

1 Answers

2
votes

You can use the new --lib option --lib es6 to just use the lib file for ES6 and still keep your compile target to be ES5.

More

More on lib option : https://github.com/Microsoft/TypeScript/issues/6974

(PS: its supported in alm https://github.com/alm-tools/alm/)