Skip to content

@wdio/elements@1.3.0: published .d.ts imports unpublished @wdio/devtools-core, re-exported types resolve to any #582

Open

Description

@Winify

Summary

@wdio/elements@1.3.0 ships dist/_tsup-dts-rollup.d.ts, which imports from @wdio/devtools-core/*:

import type { AccessibilityNode } from '@wdio/devtools-core/element-types';
import { buildSnapshot } from '@wdio/devtools-core/element-snapshot';
import { ANDROID_INTERACTABLE_TAGS } from '@wdio/devtools-core/locators';
import type { BrowserElementInfo } from '@wdio/devtools-core/element-types';
// … ~20 more from @wdio/devtools-core/{element-types,element-snapshot,locators}

@wdio/devtools-core is not published (npm view @wdio/devtools-core returns E404) and is not in dependencies. The runtime bundle inlines it, so the JS works; the type declarations do not.

Impact

  • skipLibCheck: false: consumers get TS2307: Cannot find module '@wdio/devtools-core/…' (45 errors in @wdio/mcp).
  • skipLibCheck: true (common): errors are hidden, but every type re-exported from devtools-core silently becomes any:
import type { BrowserElementInfo, GetMobileElementsOptions } from '@wdio/elements';
export const a: BrowserElementInfo = 42;               // compiles: any
export const b: GetMobileElementsOptions = 'nonsense'; // TS2559, declared locally so it resolves

Affected: BrowserElementInfo, GetBrowserElementsOptions, AccessibilityNode, Bounds, ElementWithLocators and the other locators exports, so results of getElements / getInteractableBrowserElements are untyped for consumers.

Reproduction

  1. npm i @wdio/elements@1.3.0 typescript
  2. Put the snippet above in t.ts
  3. npx tsc --noEmit --strict --module nodenext --moduleResolution nodenext t.ts: only b errors
  4. Same with --skipLibCheck false: TS2307 for @wdio/devtools-core/*

Suggested fix

Inline the internal package's declarations into the rollup: api-extractor bundledPackages: ['@wdio/devtools-core'], or tsup dts: { resolve: ['@wdio/devtools-core'] }. Alternatively publish @wdio/devtools-core and add it to dependencies.

Environment

@wdio/elements 1.3.0, TypeScript 5.9.3, Node 24.22.1.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions