Skip to content

[🐛 Bug]: create-wdio is missing dependencies with types when TypeScript is selected #14833

@gavvvr

Description

@gavvvr

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

v9.20.0

Node.js Version

v22.12.0

Mode

Standalone Mode

Which capabilities are you using?

-

What happened?

When TypeScript is selected in create-wdio starter, dependencies with types are missing.

The tsconfig.json usually references the following globals:

"types": [
    "node",
    "jasmine",
    "@wdio/globals/types",
    "expect-webdriverio",
],

but corresponding dependencies are missing in package.json, so I have to add them manually: pnpm i -D @types/node @wdio/globals expect-webdriverio

What is your expected behavior?

I would expect missing dependencies with types to be explicitly listed in package.json

How to reproduce the bug.

  1. pnpm create wdio@latest
  2. Choose "E2E testing", agree to use TypeScript
  3. Open tsconfig.json in VSCode and it will complain
Image 4. `typescript` package is also missing. Add it (`pnpm i -D typescript`) and execute `pnpm tsc --noEmit`, you will get "TS2688"-errors

Relevant log output

 pnpm tsc --noEmit
error TS2688: Cannot find type definition file for '@wdio/globals/types'.
  The file is in the program because:
    Entry point of type library '@wdio/globals/types' specified in compilerOptions

  tsconfig.json:12:13
    12             "@wdio/globals/types",
                   ~~~~~~~~~~~~~~~~~~~~~
    File is entry point of type library specified here.

error TS2688: Cannot find type definition file for 'expect-webdriverio'.
  The file is in the program because:
    Entry point of type library 'expect-webdriverio' specified in compilerOptions

  tsconfig.json:13:13
    13             "expect-webdriverio",
                   ~~~~~~~~~~~~~~~~~~~~
    File is entry point of type library specified here.


Found 2 errors.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug 🐛help wantedIssues that are free to take by anyone interested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions