Home > Blockchain >  Testcafe / Jenkins job failing TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument m
Testcafe / Jenkins job failing TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument m

Time:05-30

I have a jenkins job that has worked consistently for the past 2 years running various front end tests, but recently I've gotten a stack trace from the job in jenkins that is continuously failing where I'm unsure what to do to fix it. The stack trace is listed below from the job:

TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument must be of type function. Received undefined
    at promisify (internal/util.js:279:11)
    at Object.<anonymous> (/home/ec2-user/workspace/Sandbox_Verify/node_modules/testcafe-safe-storage/lib/file.js:18:33)
    at Module._compile (internal/modules/cjs/loader.js:1076:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:941:32)
    at Function.Module._load (internal/modules/cjs/loader.js:782:14)
    at Module.require (internal/modules/cjs/loader.js:965:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/home/ec2-user/workspace/Sandbox_Verify/node_modules/testcafe-safe-storage/lib/index.js:30:19)
    at Module._compile (internal/modules/cjs/loader.js:1076:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:941:32)
    at Function.Module._load (internal/modules/cjs/loader.js:782:14)
    at Module.require (internal/modules/cjs/loader.js:965:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/home/ec2-user/workspace/Sandbox_Verify/node_modules/testcafe/lib/dashboard/config-storage.js:3:33) {
  code: 'ERR_INVALID_ARG_TYPE'
}

CodePudding user response:

I am facing the same issue. Looks like there was a latest version of testCafe 1.19.0 version released yesterday after which the issue started. If you change your testcafe version to "testcafe": "1.18.6" or remove the ^ it should work. Or may be need to upgrade the nodejs version being used. Got the below warning

npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=14.0.0"} (current: {"node":"10.24.1","npm":"6.14.12"})

CodePudding user response:

The cause of the issue is that you are using an outdated Node.js version. The crypto.randomUUID function doesn't exist in Node.js 10.24.1. Please update it to 14.x and all will work correctly.

  • Related