You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tried to run API extractor on a file using the WebdriverIO type from webdriverio package.
API extractor does not manage to find the type. I think this is linked to the fact that webdriverio declares WebdriverIO as a global symbol (using declare global { namespace WebdriverIO { … } }) whose typing (in my code) is ensured through a triple-slash directive (/// <reference types="webdriverio" />).
API extractor just crashes in that situation (instead of, e.g., exporting a plain text symbol).
This used to work on previous version of webdriver, where the triple-slash was on webdriverio/async, but that's not the way to go with latest version.
The TS code builds without problems (crashes if I remove the directive). The code is stripped down to just using the WebdriveIO.Browser type.
Successful extraction on the real repo, using the previous major version of webdriverio.
Expected result: API extractor should be able to find the global type through the triple-slash directive, the same way TS does. Otherwise, outputting a plain text symbol would be better than crashing.
Actual result: Crash with error Internal Error: Unable to follow symbol for "WebdriverIO"
The esModuleInteropmay have something to do with this. It is needed due to how the latest webdriverio is packaged. It is a change in the config compared to previous (working) iteration.
Standard questions
Please answer these questions to help us investigate your issue more quickly:
Question
Answer
@microsoft/api-extractor version?
Operating system?
Linux Debian in a WSL1 box
API Extractor scenario?
reporting
Would you consider contributing a PR?
No (no idea what goes wrong)
TypeScript compiler version?
5.4.5
Node.js version (node -v)?
20.7.0
WebdriverIO version: 8.38.2 (worked with 7.20.5)
The text was updated successfully, but these errors were encountered:
Summary
Tried to run API extractor on a file using the
WebdriverIO
type fromwebdriverio
package.API extractor does not manage to find the type. I think this is linked to the fact that webdriverio declares
WebdriverIO
as a global symbol (usingdeclare global { namespace WebdriverIO { … } }
) whose typing (in my code) is ensured through a triple-slash directive (/// <reference types="webdriverio" />
).API extractor just crashes in that situation (instead of, e.g., exporting a plain text symbol).
This used to work on previous version of webdriver, where the triple-slash was on
webdriverio/async
, but that's not the way to go with latest version.The TS code builds without problems (crashes if I remove the directive). The code is stripped down to just using the
WebdriveIO.Browser
type.Repro steps
Failing action on a minimal repro repository.
Successful extraction on the real repo, using the previous major version of
webdriverio
.Expected result: API extractor should be able to find the global type through the triple-slash directive, the same way TS does. Otherwise, outputting a plain text symbol would be better than crashing.
Actual result: Crash with error
Internal Error: Unable to follow symbol for "WebdriverIO"
Details
Single file in my repo:
TS config:
The
esModuleInterop
may have something to do with this. It is needed due to how the latestwebdriverio
is packaged. It is a change in the config compared to previous (working) iteration.Standard questions
Please answer these questions to help us investigate your issue more quickly:
@microsoft/api-extractor
version?node -v
)?WebdriverIO version: 8.38.2 (worked with 7.20.5)
The text was updated successfully, but these errors were encountered: