Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler does not catch empty compilerHost #130

Closed
ChristophAtAdlos opened this issue Jun 7, 2017 · 5 comments
Closed

compiler does not catch empty compilerHost #130

ChristophAtAdlos opened this issue Jun 7, 2017 · 5 comments
Labels

Comments

@ChristophAtAdlos
Copy link

The error when running karma-typescript:
Fatal error: Cannot read property 'getNewLine' of undefined

In compiler.js at outputDiagnostics(), the host is an empty Object.
At setupRecompile(), the host was created with the following output from getTsconfig().options:

{
  "emitDecoratorMetadata": true,
  "experimentalDecorators": true,
  "jsx" :2,
  "module": 1,
  "sourceMap": true,
  "target": 1,
  "noImplicitAny": false,
  "configFilePath": "",
  "lib": ["lib.es2015.d.ts","lib.dom.d.ts"],
  "suppressOutputPathCheck": true
}

this results in an empty Object.
A specific error message would be helpfully.

In karma config, settings are target: "ES5" and module: "commonjs".
From where is the configFilePath collected?

@erikbarke erikbarke added the bug label Jun 7, 2017
@erikbarke erikbarke added this to the 3.0.4 milestone Jun 7, 2017
@erikbarke
Copy link
Collaborator

Hey @ChristophAtAdlos, could you attach a file with the complete debug log output here please?

@ChristophAtAdlos
Copy link
Author

You will find the debug log at Gist.

@ChristophAtAdlos
Copy link
Author

#19 helped to go further (declare tsconfig.json)
Added tsconfig: "./tsconfig-testing.json" in karmaTypescriptConfig, now it compiles. A meaningful error message in case of empty files array would help to resolve faster.

Now it hangs on Error: Cannot find module 'inherits' from '.'.

@ChristophAtAdlos
Copy link
Author

In the meantime, I got karma-typescript running. I updated npm itself to latest version and rebuilt node_modules from scratch. Tho only thing I had to make is apply the patch from #129 .

@erikbarke erikbarke added support and removed bug labels Jun 9, 2017
@erikbarke erikbarke removed this from the 3.0.4 milestone Jun 9, 2017
@erikbarke
Copy link
Collaborator

I'm gonna have to chalk this one up as a botched installation issue, I tried using the compiler options you listed and that doesn't result in an empty host. Also, the debug log you provided has a quite specific Typescript error message about not finding any files using the include paths, I'm not sure I can improve anything here.

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

No branches or pull requests

2 participants