Skip to content

Commit

Permalink
fix path argument must be of type string error
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick99e99 committed Dec 15, 2020
1 parent 2cc5495 commit c5b6b16
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/karma-webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,16 +354,18 @@ Plugin.prototype.readFile = function(file, callback) {
}
);
} else {
let output = this.outputs.get(file);

try {
const fileContents = middleware.fileSystem.readFileSync(
path.join(os.tmpdir(), '_karma_webpack_', this.outputs.get(file))
path.join(os.tmpdir(), '_karma_webpack_', output)
);

callback(null, fileContents);
} catch (e) {
// If this is an error from `readFileSync` method, wait for the next tick.
// Credit #69 @mewdriller
if (e.code === 'ENOENT') {
if (e.code === 'ENOENT' || !output) {
// eslint-disable-line quotes
this.waiting = [
process.nextTick.bind(
Expand Down

0 comments on commit c5b6b16

Please sign in to comment.