Skip to content
This repository has been archived by the owner on Feb 16, 2019. It is now read-only.

TypeError: ts.convertCompilerOptionsFromJson is not a function #1

Closed
laguiz opened this issue Mar 1, 2016 · 10 comments
Closed

TypeError: ts.convertCompilerOptionsFromJson is not a function #1

laguiz opened this issue Mar 1, 2016 · 10 comments

Comments

@laguiz
Copy link

laguiz commented Mar 1, 2016

Hi,

I'm very interested by this plugin.

Running the sample I get :

JsTaskFailure: /Users/laguiz/temp/play-angular2-typescript/project/target/typescript/sbt-typescript-0.2.2.jar:121
    var tsConfig = ts.convertCompilerOptionsFromJson(unparsedCompilerOptions, options.tsconfigDir, "tsconfig.json");
                      ^

TypeError: ts.convertCompilerOptionsFromJson is not a function
    at compile (/Users/laguiz/temp/play-angular2-typescript/project/target/typescript/sbt-typescript-0.2.2.jar:121:23)
    at Object.<anonymous> (/Users/laguiz/temp/play-angular2-typescript/project/target/typescript/sbt-typescript-0.2.2.jar:109:21)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:140:18)
    at node.js:1001:3
@laguiz laguiz changed the title Quick try issue TypeError: ts.convertCompilerOptionsFromJson is not a function Mar 1, 2016
@laguiz
Copy link
Author

laguiz commented Mar 1, 2016

My current Typescript version installed on my laptop : tsc --version > Version 1.8.2. However looking at the plugin TypeScript seems embedded so my current TS version should have no impact.

@joost-de-vries
Copy link
Owner

I've deinstalled my global npm installation of typescript. To rule out that that's used with me locally. But even without that installed it runs fine with me.
I've introduced a travis build. But of course this is a run time problem.

It should be possible to verify this using a Play integration test from CI. But that will be a bit of fiddling.

From the stack trace I notice that it starts at node.js.
Did you add a `
``JsEngineKeys.engineType := JsEngineKeys.EngineType.Node```
setting to your build.sbt perhaps? (Which does work for me locally as well btw)

@laguiz
Copy link
Author

laguiz commented Mar 2, 2016

I added JsEngineKeys.engineType := JsEngineKeys.EngineType.Node after to try if it helped but same error.

I have a good news for you : I asked a colleague that never played with TypeScript nor Angular2 and this sample just works with sbt version 0.13.8!

So it must come from my setup. I will try to clean my ivy folder and try again. I let you know my progress.

@laguiz
Copy link
Author

laguiz commented Mar 2, 2016

Still the same issue for me on MacOS. My colleague is on Windows. What is your OS?

@laguiz
Copy link
Author

laguiz commented Mar 2, 2016

Issue fixed on my MacOS. I had to uninstall my locally installed typescript with npm uninstall typescript -g. Now it works as expected.

I tried to reinstalled typescript to see if there is any conflict by doing npm install typescript -g and it still works.

Not sure what was wrong with my current typescript version installed globally.

I'll closer now at the plugin :)

@joost-de-vries
Copy link
Owner

That's surprising Maxence... Keep me informed.

My colleagues tried the template as well. They could run it from activator, but couldn't from sbt...
So that's something I'll investigate.

@laguiz
Copy link
Author

laguiz commented Mar 2, 2016

Well for me activator and sbt both work now and I have typescript reinstalled (from npm). Not sure if I can reproduce the issue now.

What error your colleagues got?

@joost-de-vries
Copy link
Owner

I'm glad it's working for you.
Regarding my colleagues: I'm wondering if they forgot to stop their activator uit server. I'll check with them tomorrow.

@laguiz
Copy link
Author

laguiz commented Mar 3, 2016

Fyi : I tried with sbt-digest and sbt-gzip and it works perfectly. Very good job here.

@joost-de-vries
Copy link
Owner

Cool. I guess this isssue is solved then.
I've updated the readme with a warning for others.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants