testcafe icon indicating copy to clipboard operation
testcafe copied to clipboard

Hammerhead fails to load main javascript files, throws TypeError: ExprGen[itemType] is not a function

Open wbrzosko opened this issue 3 years ago • 3 comments
trafficstars

What is your Scenario?

While starting new tests the main javascript file is not loaded and the following error occurs in the console:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

The file url without the proxy or !s!utf-8 param in the url works just fine.

What is the Current behavior?

Testcafe throws the Failed to load resource: the server responded with a status of 500 (Internal Server Error). When trying to open the file in a new tab the TypeError: ExprGen[itemType] is not a function error is displayed.

What is the Expected behavior?

Tests used to access javascript files just fine.

What is your public website URL? (or attach your complete example)

testcafe-issue.zip

What is your TestCafe test code?

await t .click('#selectLanguage') .click(Selector('option').filter('[value="0"]')) .typeText('#username', username) .typeText('#password', password || username) .click(Selector('button').withText('Log in')) .expect(Selector('.brand-name').textContent).contains('xx');

Your complete configuration file

Just running testcafe chrome testcafe/test.js

Your complete test report

No response

Screenshots

typerror Uploading error.png…

Steps to Reproduce

  1. Npm install
  2. testcafe chrome testcafe/test.js

TestCafe version

2.0.0

Node.js version

16.17.0

Command-line arguments

testcafe chrome testcafe/test.js

Browser name(s) and version(s)

Chrome Version 105.0.5195.53 (Official Build) (64-bit)

Platform(s) and version(s)

Windows 10 Enterprise

Other

No response

wbrzosko avatar Sep 06 '22 09:09 wbrzosko

Hi @wbrzosko, I could not reproduce this behavior. However, I managed to reproduce the hanging of TestCafe with the example you shared. It occurs due to the incorrect URL of the tested page.

fixture `Getting Started`
    .page `https://`;

Could you please check the example and update it to reproduce the original issue?

miherlosev avatar Sep 07 '22 09:09 miherlosev

Hi @miherlosev, thanks for looking into this issue. I have sent URL and authentication details to [email protected] as instructed in the issue creating steps. If you are able to get them and fill out in the example it should work.

wbrzosko avatar Sep 07 '22 09:09 wbrzosko

Thank you for the shared information. I've reproduced the issue.

miherlosev avatar Sep 08 '22 06:09 miherlosev

Hi @miherlosev, any updates on this issue?

Experiencing a similar case. The page couldn't be opened and the following error was thrown:

vendor.js:36 Uncaught TypeError: ExprGen[itemType] is not a function
    at Object.generateClassBody [as ClassBody] (hammerhead.js:5861:31)
    at Object.generateClassExpression [as ClassExpression] (hammerhead.js:5427:29)
    at exprToJs (hammerhead.js:6435:25)
    at Object.generateNewExpression [as NewExpression] (hammerhead.js:5233:29)
    at run (hammerhead.js:6462:29)
    at generate (hammerhead.js:6561:13)
    at getCode (hammerhead.js:13969:17)
    at applyChanges (hammerhead.js:14020:22)
    at processScript (hammerhead.js:14040:39)
    at value (hammerhead.js:21228:29)

The error is reproduced from [email protected] but ok in 1.18.5 node v14.19.1

getahead avatar Nov 15 '22 22:11 getahead

Hi @getahead,

We don't have any updates. Once we have any news, we'll write about it here.

Aleksey28 avatar Nov 17 '22 08:11 Aleksey28

Any updates on this? We are also suddenly experiencing a similar issue.

tgrisley avatar Apr 14 '23 12:04 tgrisley

Hi @Aleksey28 , @miherlosev We start hitting the same error TypeError: ExprGen[itemType] is not a function all of a sudden. As @getahead mentioned it happens with all versions starting from [email protected] & up. Downgrading to an old Version 1.18.5 makes it working.

Eng-raghad avatar Apr 15 '23 20:04 Eng-raghad

@tgrisley @Eng-raghad Thank you for reaching out to us. It looks like the recent issues are not related to the original one. We will investigate the issue and get back to you with a fix or workaround.

AlexKamaev avatar Apr 17 '23 07:04 AlexKamaev

Any updates on this? We are also suddenly experiencing this similar issue.

aarav-chegg avatar Apr 17 '23 08:04 aarav-chegg

applying yarn or npm patch works: https://github.com/DevExpress/testcafe/issues/7632#issuecomment-1510974419

patrickathompson avatar Apr 17 '23 16:04 patrickathompson

Hello,

Thank you for the feedback. We are working on the problem. Please follow this issue to track our progress. I will close the current issue as duplicate.

aleks-pro avatar Apr 18 '23 07:04 aleks-pro