Value should be string- Invalid argument e2e test

I am running a e2e test for an angular application by protractor, but I am getting the following error when running the test for a feature file

Value in UI which I am checking is -WORKSCOPES (2239)

Code for the steps in steps.js:

this.Then(/^I get the workscope count$/, (callback) => {  
        
            workscopeUtil.getTextUsingTestHelperPo('div[class="new-workscope-header col-12 col-md-12 mt-3 mb-3"]').then(actualVal => {                  
            wsCountBeforeReset = actualVal.match(/(([^)]+))/)[1];
            console.log('workscopeCount :'+wsCountBeforeReset);
            callback();
        });
    });

Error when running the feature file test is :

Failures:

1) Scenario: US13241:1of1 Search with ESN and results should be displayed in a carousel - Test_ModulesWorkscopeFeaturesWorkscopeSearch.feature:24
   Step: And I get the workscope count - Test_ModulesWorkscopeFeaturesWorkscopeSearch.feature:8
   Step Definition: Test_ModulesWorkscopestep_definitionsWorkscopeAdditionalFilters_Steps.js:262
   Message:
     WebDriverError: invalid argument: 'value' must be a string
       (Session info: chrome=84.0.4147.135)
       (Driver info: chromedriver=83.0.4103.14 (be04594a2b8411758b860104bc0a1033417178be-refs/branch-heads/[email protected]{#119}),platform=Windows NT 10.0.17763 x86_64)
         at WebDriverError (C:Users2622018dmro-workspaceWorkscope-E2E-Automationnode_modulesselenium-webdrivererror.js:27:5)
         at Object.checkLegacyResponse (C:Users2622018dmro-workspaceWorkscope-E2E-Automationnode_modulesselenium-webdrivererror.js:580:13)
         at C:Users2622018dmro-workspaceWorkscope-E2E-Automationnode_modulesselenium-webdriverlibwebdriver.js:360:15
         at Promise.invokeCallback_ (C:Users2622018dmro-workspaceWorkscope-E2E-Automationnode_modulesselenium-webdriverlibpromise.js:1329:14)
         at TaskQueue.execute_ (C:Users2622018dmro-workspaceWorkscope-E2E-Automationnode_modulesselenium-webdriverlibpromise.js:2790:14)
         at TaskQueue.executeNext_ (C:Users2622018dmro-workspaceWorkscope-E2E-Automationnode_modulesselenium-webdriverlibpromise.js:2773:21)
         at asyncRun (C:Users2622018dmro-workspaceWorkscope-E2E-Automationnode_modulesselenium-webdriverlibpromise.js:2652:27)
         at C:Users2622018dmro-workspaceWorkscope-E2E-Automationnode_modulesselenium-webdriverlibpromise.js:639:7
         at process._tickCallback (internal/process/next_tick.js:109:7)
     From: Task: <anonymous>
         at pollCondition (C:Users2622018dmro-workspaceWorkscope-E2E-Automationnode_modulesselenium-webdriverlibpromise.js:2236:16)
         at C:Users2622018dmro-workspaceWorkscope-E2E-Automationnode_modulesselenium-webdriverlibpromise.js:2232:9
         at new Promise (C:Users2622018dmro-workspaceWorkscope-E2E-Automationnode_modulesselenium-webdriverlibpromise.js:1043:7)
         at C:Users2622018dmro-workspaceWorkscope-E2E-Automationnode_modulesselenium-webdriverlibpromise.js:2231:14
         at TaskQueue.execute_ (C:Users2622018dmro-workspaceWorkscope-E2E-Automationnode_modulesselenium-webdriverlibpromise.js:2790:14)
         at TaskQueue.executeNext_ (C:Users2622018dmro-workspaceWorkscope-E2E-Automationnode_modulesselenium-webdriverlibpromise.js:2773:21)
         at asyncRun (C:Users2622018dmro-workspaceWorkscope-E2E-Automationnode_modulesselenium-webdriverlibpromise.js:2697:25)
         at C:Users2622018dmro-workspaceWorkscope-E2E-Automationnode_modulesselenium-webdriverlibpromise.js:639:7
         at process._tickCallback (internal/process/next_tick.js:109:7)
     From: Task: <anonymous wait>
         at ControlFlow.wait (C:Users2622018dmro-workspaceWorkscope-E2E-Automationnode_modulesselenium-webdriverlibpromise.js:2229:17)
         at Driver.wait (C:Users2622018dmro-workspaceWorkscope-E2E-Automationnode_modulesselenium-webdriverlibwebdriver.js:688:29)
         at Protractor.to.(anonymous function) [as wait] (C:Users2622018dmro-workspaceWorkscope-E2E-Automationnode_modulesprotractorbuiltprotractor.js:55:29)
         at World.When (C:Users2622018dmro-workspaceWorkscope-E2E-AutomationTest_ModulesWorkscopestep_definitionsWorkscopeSearch_Steps.js:159:17)
         at _combinedTickCallback (internal/process/next_tick.js:73:7)
         at process._tickCallback (internal/process/next_tick.js:104:9)

Source: Angular Questions