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

When I install "@testing-library/react": "^11.2.5" in an existing project with tslint, I get missing kcd-scripts warning #883

Closed
justin-calleja opened this issue Mar 13, 2021 · 3 comments · Fixed by #893
Labels
bug Something isn't working

Comments

@justin-calleja
Copy link

justin-calleja commented Mar 13, 2021

  • @testing-library/react: 11.2.5
  • Testing Framework and version: jest at 26.6.3
  • DOM Environment: jsdom at 11.12.0

What you did:

install "@testing-library/react": "^11.2.5" via adding directly in package.json and lerna bootstrap.

What happened:

Cannot read file '.../node_modules/@testing-library/react/node_modules/kcd-scripts/shared-tsconfig.json'.

Problem description:

A dependency of react-testing-library is not being installed. In react-testing-library's package.json:

 "eslintConfig": {
    "extends": "./node_modules/kcd-scripts/eslint.js",

So my editor now requires the existance of that eslint.js file.

Suggested solution:

Add the missing kcd-scripts in dependencies of react-testing-library.

When I install kcd-scripts alongside @testing-library/react in my package devDependencies (and restart TS server in vs code), then the error goes away. But I would expect that the expected behaviour is to just install @testing-library/react and not get the error in the first place 🙂

@MatanBobi
Copy link
Member

Hi @justin-calleja, thanks for taking the time to open this :)
It looks like you're looking for the shared-tsconfig.json which is being used in our tsconfig.
The eslint configs you've added here are there for a few years now and nothing was changed there. Also, the eslint+tsconfig are only used as a dev dependency..
Can you please add your tsconfig so we'll be able to look into what's going on and why you're trying to load the shared-tsconfig.json file?

@nickserv nickserv added the question Further information is requested label Mar 17, 2021
@ryan-rushton
Copy link

ryan-rushton commented Mar 30, 2021

Hi I am seeing something similar

Cannot read file '/Users/ryanrushton/dev/my-project/node_modules/@testing-library/react/node_modules/kcd-scripts/shared-tsconfig.json'.

This is what the @testing-library package in my node_modules looks like

Screen Shot 2021-03-30 at 2 55 48 pm

And this is my tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react-jsx",
    "baseUrl": "src",
    "noFallthroughCasesInSwitch": true
  },
  "include": [
    "src"
  ]
}

@MatanBobi MatanBobi added bug Something isn't working and removed question Further information is requested labels Mar 30, 2021
@MatanBobi
Copy link
Member

Thanks @ryan-rushton, This Issue is fixed in version 11.2.6 🎉

The release is available on:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants