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

[karma-server]: UncaughtException:: file.detectType is not a function #3537

Closed
marleypowell opened this issue Jul 2, 2020 · 1 comment
Closed

Comments

@marleypowell
Copy link

Running karma server tests with bazel returns: [karma-server]: UncaughtException:: file.detectType is not a function.

Expected behaviour - karma 5.0.6

When running tests using bazel they should pass without returning any errors.

INFO: Analyzed 2 targets (0 packages loaded, 0 targets configured).
INFO: Found 2 test targets...
INFO: From Extracting ../org_chromium_chromium/file/chrome-win.zip:
INFO: Elapsed time: 14.348s, Critical Path: 11.00s
INFO: 4 processes: 3 local, 1 worker.
INFO: Build completed successfully, 4 total actions
//libs/ui/button:unit_tests_firefox-local                                PASSED in 0.4s
//libs/ui/button:unit_tests_chromium-local                               PASSED in 4.7s

Actual behaviour - karma 5.1.0

When running the tests with bazel an error is returned.
Screenshot_2

02 07 2020 13:08:20.067:INFO [karma-server]: Karma v5.1.0 server started at http://0.0.0.0:9876/
02 07 2020 13:08:20.077:INFO [launcher]: Launching browsers ChromeHeadless with concurrency unlimited
02 07 2020 13:08:20.080:INFO [launcher]: Starting browser ChromeHeadless
02 07 2020 13:08:21.151:INFO [Chrome Headless 76.0.3809.0 (Windows 10)]: Connected on socket rFmqendtFxCD0ToIAAAA with id 82687778
02 07 2020 13:08:21.306:ERROR [karma-server]: UncaughtException:: file.detectType is not a function
02 07 2020 13:08:21.307:ERROR [karma-server]: TypeError: file.detectType is not a function
    at C:\users\marley.powell\_bazel_marley.powell\ysuom6yx\external\npm\node_modules\karma\lib\middleware\karma.js:165:48
    at C:\users\marley.powell\_bazel_marley.powell\ysuom6yx\external\npm\node_modules\karma\lib\middleware\common.js:77:36
    at C:\users\marley.powell\_bazel_marley.powell\ysuom6yx\external\npm\node_modules\karma\node_modules\graceful-fs\graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)
================================================================================
INFO: Elapsed time: 341.598s, Critical Path: 28.04s
INFO: 13 processes: 8 local, 5 worker.
INFO: Build completed, 1 test FAILED, 55 total actions
//libs/ui/button:unit_tests_firefox-local                                PASSED in 0.4s
//libs/ui/button:unit_tests_chromium-local                               FAILED in 6.4s
  C:/users/marley.powell/_bazel_marley.powell/ysuom6yx/execroot/exclaimer/bazel-out/x64_windows-fastbuild/testlogs/libs/ui/button/unit_tests_chromium-local/test.log

Executed 2 out of 2 tests: 1 test passes and 1 fails locally.
There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see whiINFO: Build completed, 1 test FAILED, 55 total actions

Environment Details

  • Karma version (output of karma --version):
    5.1.0

This commit is where I think the issue was introduced: https://github.com/karma-runner/karma/commit/f399063d1bc8954dba74166ea3dabef2fe376ae4
#3509

karma v5.0.6 doesn't include this bug.

@devoto13
Copy link
Collaborator

devoto13 commented Jul 2, 2020

To me this sounds like the problem is that Bazel plugin creates file object incorrectly here. FileList should contain File or Url objects not arbitrary plain object. This is what is causing the issue and it should be fixed in the Bazel plugin.

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

No branches or pull requests

2 participants