HerringtonDarkholme / typescript-repl

An upgraded TypeScript REPL
210 stars 16 forks source link

Error when running with tsconfig.json #11

Closed niwsa closed 8 years ago

niwsa commented 8 years ago

I have a tsconfig.json file with the following contents

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false
  }
}

From the same directory I spawned a tsun and got the below error

$ tsun
TSUN : TypeScript Upgraded Node
type in TypeScript expression to evaluate
type :help for commands in repl

> class Cat {
..name: string;
..meow() {
....return `${this.name} says Meow!`;
....}
..}
evalmachine.<anonymous>:1
{"version":3,"file":"TSUN.repl.generated.js","sourceRoot":"","sources":["TSUN.repl.generated.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,uFAAuF;AACvF;IAAA;IAKA,CAAC;IAHD,kBAAI,GAAJ;QACA,MAAM,CAAI,IAAI,CAAC,IAAI,gBAAa,CAAC;IACjC,CAAC;IACD,UAAC;AAAD,CAAC,AALD,IAKC"}
          ^
SyntaxError: Unexpected token :
    at Object.exports.runInContext (vm.js:43:16)
    at startEvaluate (/usr/local/lib/node_modules/tsun/bin/src/repl.js:199:25)
    at replLoop (/usr/local/lib/node_modules/tsun/bin/src/repl.js:223:9)
    at /usr/local/lib/node_modules/tsun/bin/src/repl.js:330:9
    at Interface._onLine (readline.js:222:5)
    at Interface._line (readline.js:566:8)
    at Interface._ttyWrite (readline.js:843:14)
    at ReadStream.onkeypress (readline.js:115:10)
    at emitTwo (events.js:106:13)
    at ReadStream.emit (events.js:191:7)
> 

Is there something wrong with the config?

HerringtonDarkholme commented 8 years ago

Try removing sourceMap

niwsa commented 8 years ago

Yup it worked :) thanks closing the issue