istanbul-instrumenter-loader icon indicating copy to clipboard operation
istanbul-instrumenter-loader copied to clipboard

* Export Undefined Error

Open ianrtracey opened this issue 7 years ago • 2 comments

"istanbul-instrumenter-loader": "^1.2.0",

There exists an index.ts library file with some * exports.

//index.ts
export * from './some-file'
...

When importing this new library file with the loader argument istanbul-instrumenter-loader?esModules=true' the resulting karma runner failure is:

Uncaught TypeError: Cannot read property 'f' of undefined at webpack:///src/integration-test/mock-service/services/index.ts:9:7 <- test.context.js:281375 (Which is the line number of the last * export)

When the star exports are removed, the coverage runner succeeds. Not sure why. Strangely enough, the exact same codebase compiles and runs successfully within the karma suite when the instanbul-instrumenter-loader is removed.

ianrtracey avatar Feb 14 '18 21:02 ianrtracey

I dunno if this is the same issue, but the error is the same and in our case a circular dependency was causing the error.

snapwich avatar Jul 18 '19 23:07 snapwich

Same issue, thx @snapwich for pointing out the circular dependency!

bcaudan avatar Jul 19 '19 08:07 bcaudan