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

Using exported constant in cy.wait() throws "TypeError: Cannot read property 'undefined' of undefined" #78

Open
Zaxcoding opened this issue Mar 26, 2021 · 3 comments
Labels

Comments

@Zaxcoding
Copy link

Steps to reproduce

  • In a typescript file, define a const number
  • In a second typescript file, import that const
  • Use the imported const in a cy.wait() call

Expected behavior

  • See "no-unnecessary-waiting" ESLint violation

Actual behavior

  • See "TypeError: Cannot read property 'undefined' of undefined", which can't be ignored by ESLint

Stacktrace:

TypeError: Cannot read property 'undefined' of undefined
Occurred while linting filename.ts:15
at isIdentifierNumberConstArgument (/node_modules/eslint-plugin-cypress/lib/rules/no-unnecessary-waiting.js:72:39)
at CallExpression (/node_modules/eslint-plugin-cypress/lib/rules/no-unnecessary-waiting.js:22:15)
at /node_modules/eslint/lib/linter/safe-emitter.js:45:58

Relevant line

const param = definition.node.params[definition.index]

@luanraithz
Copy link

We are having the same issue, any workaround besides turning off this rule?

@CallumHoward
Copy link

Same issue here too

@CallumHoward
Copy link

Linking related PR here: #90

@MikeMcC399 MikeMcC399 added the bug label Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants