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

fix path argument must be of type string error #455

Closed
wants to merge 1 commit into from

Conversation

patrick99e99
Copy link

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

Intermittently the call to this.outputs.get(file); is undefined. Checking for the presence of this file and waiting if its not there fixes the problem.

10 12 2020 18:37:17.496:ERROR [karma-server]: UnhandledRejection
infrastructure_error TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
    at validateString (internal/validators.js:125:11)
    at Object.join (path.js:1147:7)
    at Plugin.<anonymous> (/Users/me/my-app/node_modules/karma-webpack/dist/karma-webpack.js:318:70)
    at Plugin.readFile (/Users/me/my-app/node_modules/karma-webpack/dist/karma-webpack.js:334:5)
    at /Users/me/my-app/node_modules/karma-webpack/dist/karma-webpack.js:353:19
    at executeProcessor (/Users/me/my-app/node_modules/karma/lib/preprocessor.js:28:11)
    at runProcessors (/Users/me/my-app/node_modules/karma/lib/preprocessor.js:41:23)
    at /Users/me/my-app/node_modules/karma/lib/preprocessor.js:144:9
    at module.exports (/Users/me/my-app/node_modules/isbinaryfile/index.js:29:12)
    at readFileCallback (/Users/me/my-app/node_modules/karma/lib/preprocessor.js:116:7)
    at /Users/me/my-app/node_modules/graceful-fs/graceful-fs.js:90:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
From previous event:
    at Promise.map (/Users/me/my-app/node_modules/karma/lib/file-list.js:89:51)
From previous event:
    at Promise.map (/Users/me/my-app/node_modules/karma/lib/file-list.js:89:25)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
From previous event:
    at FileList._refresh (/Users/me/my-app/node_modules/karma/lib/file-list.js:64:8)
    at FileList.refresh (/Users/me/my-app/node_modules/karma/lib/file-list.js:158:29)
    at Server.refreshFiles (/Users/me/my-app/node_modules/karma/lib/server.js:146:44)
    at Plugin.notifyKarmaAboutChanges (/Users/me/my-app/node_modules/karma-webpack/dist/karma-webpack.js:250:16)
    at Plugin.done (/Users/me/my-app/node_modules/karma-webpack/dist/karma-webpack.js:193:12)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/me/my-app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/me/my-app/node_modules/tapable/lib/Hook.js:154:20)
    at Watching._done (/Users/me/my-app/node_modules/webpack/lib/Watching.js:98:28)
    at compiler.emitRecords.err (/Users/me/my-app/node_modules/webpack/lib/Watching.js:73:19)
    at Compiler.emitRecords (/Users/me/my-app/node_modules/webpack/lib/Compiler.js:499:39)
    at compiler.emitAssets.err (/Users/me/my-app/node_modules/webpack/lib/Watching.js:54:20)
    at hooks.afterEmit.callAsync.err (/Users/me/my-app/node_modules/webpack/lib/Compiler.js:485:14)
    at _promise0.then._result0 (eval at create (/Users/me/my-app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:13:1)

Breaking Changes

Additional Info

@thijstriemstra
Copy link

@patrick99e99 can you make this pull request against the next branch?

@codymikol
Copy link
Owner

Is this still something you're interested in?

@codymikol
Copy link
Owner

The cases where this happens should be handled in v5, thanks for your contribution though!

@codymikol codymikol closed this Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants