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

bug: A new Playwright and Checkly project lead to a TypeScript version mismatch warning #974

Open
stefanjudis opened this issue Nov 2, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@stefanjudis
Copy link
Collaborator

Node.js version

23

NPM version

10.9

@checkly/cli version

latest (v4.8.1)

Steps to reproduce

npm init playwright@latest
npm init checkly
npx checkly test

Leads to this warning.

grafik

Things still work as expected but the warning isn't very "trustworthy". 🫣

What is expected?

No TypeScript version mismatch warning.

What is actually happening?

A warning is printed out.

Any additional comments?

No response

@stefanjudis stefanjudis added the bug Something isn't working label Nov 2, 2024
@hdf1996
Copy link

hdf1996 commented Dec 16, 2024

I've been able to reproduce with a new project:

mkdir checkly-test
cd checkly-test
npm init -y
npm create checkly # Accept to initialize the project and install dependencies

Which leads to the same error

➜  checkly-test git:(master) ✗ npx checkly test --record
Parsing your project... ⣟
=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=4.3.5 <5.4.0

YOUR TYPESCRIPT VERSION: 5.7.2

Please only submit bug reports when using the officially supported version.

Parsing your project... done

Running 2 checks in eu-west-1.

__checks__/api.check.ts
  ✔ Books API (221ms)
__checks__/homepage.spec.ts
  ✔ homepage.spec.ts (6s)

2 passed, 2 total

Dependencies in the package json look like this:

  "devDependencies": {
    "checkly": "latest",
    "ts-node": "latest",
    "typescript": "latest"
  }

@hdf1996
Copy link

hdf1996 commented Dec 17, 2024

After some extra digging, I've also found out that the warning doesn't happen if you create the project on a folder without a package json

cd new-folder # Just making sure we aren't in a package.json folder
npm create checkly # Accept creating a new project and select creating a new TS-compatible template
➜  peach-hippopotamus git:(master) ✗ npx checkly test --record
Parsing your project... done

Running 4 checks in eu-west-1.

src/__checks__/api.check.ts
  ✔ Books API (217ms)
src/__checks__/home.check.ts
  ✔ Home page (6s)
  ✔ Login Check (6s)
src/__checks__/multi-step-spacex.check.ts
  ✔ SpaceX MS (4s)

4 passed, 4 total

The main difference here is that the package json now contains explicit versions for typescript and ts-node devDependencies:

  "devDependencies": {
    "checkly": "latest",
    "ts-node": "10.9.1",
    "typescript": "4.9.5"
  }

Looks like this flow of the CLI action takes the package.json dependencies (and other template files) from here and the other examples in the https://github.com/checkly/checkly-cli/tree/main/examples folder. But the flow of my previous comment and also Stefan's is using https://github.com/checkly/checkly-cli/blob/main/packages/create-cli/src/actions/dependencies.ts#L18 which uses latest, potentially causing this and some other incompatibilities

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

No branches or pull requests

2 participants