Definitelytyped: @types/karma broken with removal of log4js typings

Created on 12 Oct 2017  路  17Comments  路  Source: DefinitelyTyped/DefinitelyTyped

  • [x] I tried using the @types/karma package and had problems.
  • [x] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
  • [x] I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
  • [x] [Mention](https://github.com/blog/821-mention-somebody-they-re-notified) the authors (see Definitions by: in index.d.ts) so they can respond.

    • Authors: @tkrotoff

20518 had removed the log4js typings from DT, as they are now on the log4js repo; however, Karma's typings are now broken as log4js does not export AppenderConfigBase:

Namespace '"/path/to/project/node_modules/log4js/index"' has no exported member 'AppenderConfigBase'

Most helpful comment

We fixed our build by including the previous version of log4js ahead of karma:
"devDependencies": { ... "@types/log4js": "0.0.33", "@types/bowser": "1.0.30", "@types/jasmine": "2.5.51", "@types/karma": "0.13.35", "@types/lodash": "4.14.65" }

All 17 comments

+1.
I'm facing this issue too.

(286,26): error TS2694: Namespace '"node_modules/log4js/index"' has no exported member 'AppenderConfigBase'.

+1

+1

Is there a workaround till this is fixed?
I'm running unit tests on TravisCI.
I tried "@types/karma": "1.7.0", to have it installed the exact version I have locally (which doesn't break). The tests run fine locally. But they break on TravisCI

+1

+1

+1

Not a fix, but as a workaround, you can manually add

export interface AppenderConfigBase {
  type: string;
  category?: string;
  layout?: { type: string;[key: string]: any }
}

to node_modules/log4js/index.d.ts to get going and continue work for now

We fixed our build by including the previous version of log4js ahead of karma:
"devDependencies": { ... "@types/log4js": "0.0.33", "@types/bowser": "1.0.30", "@types/jasmine": "2.5.51", "@types/karma": "0.13.35", "@types/lodash": "4.14.65" }

+1

+1

+1

~I think the Karma typings still need published before this should be closed?~

Published as 1.7.1, thanks! 馃帀

Facing the same issue with 1.7.1

@vatsalpande The newest @types/karma doesn't import anything from log4js so you probably had an error while trying to update it -- double-check the actual version in node_modules/@types/karma/package.json.

Looks like a miss from my side. Its working fine now. Thanks for your input.

as @cschear said, for me I only had to add the following one: "devDependencies": { ... "@types/log4js": "0.0.33", ...}

Was this page helpful?
0 / 5 - 0 ratings