question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[typescript] Cannot find name 'JQuery'

See original GitHub issue
  • cypress-testing-library version: 5.0.2
  • node version: 12.13.0
  • npm (or yarn) version: (yarn) 1.19.1

What you did: Installed @testing-library/cypress in monorepo root (yarn add -W -D @testing-library/cypress).

What happened: Unrelated build failures in packages/ resulting in

../../../node_modules/@types/testing-library__cypress/index.d.ts:445:77 - error TS2304: Cannot find name 'JQuery'.

Reproduction repository: https://github.com/a-b-r-o-w-n/testing-library-cypress-bug https://github.com/a-b-r-o-w-n/testing-library-cypress-bug/runs/303541569

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
gnapsecommented, Mar 19, 2020

I hit this issue in a repo that does not have any monorepo/lerna setup. Tried various things from this discussion here and also from the one linked to above in DT, and nothing helped. The only thing that helped was to explicitly install @types/jquery as a dev dependency.

Here’s the tsconfig files if that helps:

root tsconfig

{
    "compilerOptions": {
        "noEmit": true,
        "allowJs": true,
        "checkJs": true,
        "target": "es6",
        "moduleResolution": "Node",
        "resolveJsonModule": true,
        "declaration": true,
        "noImplicitReturns": true,
        "jsx": "react",
        "allowSyntheticDefaultImports": true,
        "baseUrl": "."
    },
    "include": ["./src/**/*"],
    "exclude": ["node_modules", "built", "cypress"]
}

cypress/tsconfig.json

{
    "compilerOptions": {
        "strict": true,
        "baseUrl": "../node_modules",
        "target": "es5",
        "lib": ["es5", "dom"],
        "types": ["cypress"]
    },
    "exclude": []
}
1reaction
kentcdoddscommented, Nov 27, 2019

Sorry, I don’t have the bandwidth to look at this right now. Anyone is welcome to dig a little bit and suggest a solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript and JQuery compile error: Cannot find name '$'
I'm testing typescript with jquery, but when I compile the test.ts file, it always gives me an error indicating: Cannot find name '$'....
Read more >
Cannot find name 'jQuery' Error in TypeScript | bobbyhadz
To solve the error "Cannot find name jQuery", make sure to install the jQuery library by running npm install jquery and install its...
Read more >
Typescript and JQuery compile error: Cannot find name '$'
I'm testing typescript with jquery, but when I compile the test.ts file, it always gives me an error indicating: Cannot find name '$'....
Read more >
Typescript and JQuery compile error: Cannot find name '$'
jQuery : Typescript and JQuery compile error: Cannot find name '$' [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] ...
Read more >
TS2304:Cannot find name &#039
How can I get rid of this typescript error I get in Angular2? It works fine but it's annoying. Thank you, Peter K....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found