webdriverio: [š Bug]: Suddenly all of my scripts being stopped executing
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
9.12.3
Node.js Version
22.13.1
Mode
WDIO Testrunner
Which capabilities are you using?
What happened?
everyth9ing fails with below errror
025-06-12T14:25:35.719Z INFO @wdio/local-runner: Run worker command: run 2025-06-12T14:25:36.172Z DEBUG @wdio/runner: init remote session 2025-06-12T14:25:36.180Z DEBUG @wdio/utils:initializeServices: initialize service āsauceā as NPM package 2025-06-12T14:25:37.891Z DEBUG @wdio/utils:initializeServices: initialize service āinterceptā as NPM package 2025-06-12T14:25:37.917Z DEBUG @wdio/utils:initializeServices: initialize service āsauceā as NPM package 2025-06-12T14:25:37.925Z DEBUG @wdio/utils:initializeServices: initialize service āsauceā as NPM package 2025-06-12T14:25:37.935Z DEBUG @wdio/utils:shim: Finished to run ābeforeSessionā hook in 0ms 2025-06-12T14:25:38.312Z ERROR @wdio/local-runner: Failed launching test session: Error: Couldnāt initialize ā@wdio/cucumber-frameworkā. TypeError: (0 , class_transformer_1.Type) is not a function at <anonymous> (C:\ui\wdio\node_modules@cucumber\cucumber\node_modules@cucumber\messages\src\messages.ts:14:8) at Object.<anonymous> (C:\ui\wdio\node_modules@cucumber\cucumber\node_modules@cucumber\messages\src\messages.ts:4:1) at loadCJSModule (node:internal/modules/esm/translators:161:3) at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:196:7) at ModuleJob.runSync (node:internal/modules/esm/module_job:258:17) at require (node:internal/modules/esm/translators:146:9) at Object.<anonymous> (C:\ui\wdio\node_modules@cucumber\cucumber\node_modules@cucumber\messages\src\parseEnvelope.ts:1:1) at loadCJSModule (node:internal/modules/esm/translators:161:3) at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:196:7) at ModuleJob.runSync (node:internal/modules/esm/module_job:258:17) at safeImport (C:\ui\wdio\node_modules@wdio\utils\build\index.js:292:11) at async initializePlugin (C:\ui\wdio\node_modules@wdio\utils\build\index.js:485:24) at async #initFramework (file:///C:/ui/wdio/node_modules/@wdio/runner/build/index.js:776:26) at async Runner.run (file:///C:/ui/wdio/node_modules/@wdio/runner/build/index.js:694:23)
What is your expected behavior?
No response
How to reproduce the bug.
xyz
Relevant log output
2025-06-12T14:53:43.549Z INFO @wdio/local-runner: Run worker command: run
2025-06-12T14:53:43.972Z DEBUG @wdio/runner: init remote session
2025-06-12T14:53:43.980Z DEBUG @wdio/utils:initializeServices: initialize service "sauce" as NPM package
2025-06-12T14:53:45.937Z DEBUG @wdio/utils:initializeServices: initialize service "intercept" as NPM package
2025-06-12T14:53:45.970Z DEBUG @wdio/utils:initializeServices: initialize service "sauce" as NPM package
2025-06-12T14:53:45.974Z DEBUG @wdio/utils:initializeServices: initialize service "sauce" as NPM package
2025-06-12T14:53:45.985Z DEBUG @wdio/utils:shim: Finished to run "beforeSession" hook in 0ms
2025-06-12T14:53:46.373Z ERROR @wdio/local-runner: Failed launching test session: Error: Couldn't initialize "@wdio/cucumber-framework".
TypeError: (0 , class_transformer_1.Type) is not a function
at <anonymous> (C:\ui\wdio\node_modules\@cucumber\cucumber\node_modules\@cucumber\messages\src\messages.ts:14:8)
at Object.<anonymous> (C:\ui\wdio\node_modules\@cucumber\cucumber\node_modules\@cucumber\messages\src\messages.ts:4:1)
at loadCJSModule (node:internal/modules/esm/translators:161:3)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:196:7)
at ModuleJob.runSync (node:internal/modules/esm/module_job:258:17)
at require (node:internal/modules/esm/translators:146:9)
at Object.<anonymous> (C:\ui\wdio\node_modules\@cucumber\cucumber\node_modules\@cucumber\messages\src\parseEnvelope.ts:1:1)
at loadCJSModule (node:internal/modules/esm/translators:161:3)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:196:7)
at ModuleJob.runSync (node:internal/modules/esm/module_job:258:17)
at safeImport (C:\ui\wdio\node_modules\@wdio\utils\build\index.js:292:11)
at async initializePlugin (C:\ui\wdio\node_modules\@wdio\utils\build\index.js:485:24)
at async #initFramework (file:///C:/ui/wdio/node_modules/@wdio/runner/build/index.js:776:26)
at async Runner.run (file:///C:/ui/wdio/node_modules/@wdio/runner/build/index.js:694:23)
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
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 3
- Comments: 24 (5 by maintainers)
The issue lies in some different peer dependency that received some update and due to semantic versioning is causing builds to fail. Immediate workaround to unblock yourself will be to use an old package-lock.json which worked earlier or if you have a shrink wrap file, use that.
For what it is worth, all of our tests started to have issues and we tracked it down to a tsx upgrade being pulled in by one of our WebdriverIO dependencies. Many others started reporting issues and they have since reverted the changes: https://github.com/privatenumber/tsx/issues/727
The timing lines up perfectly for what is being reported here, and since the WebdriverIO package.json is using ^ we were all getting this broken tsx, and are now getting the fixed tsx.
In case this helps, I wonder if it is related to the release of v8 stuff with this release https://github.com/webdriverio/webdriverio/releases/tag/v8.45.0 . The timing matches the errors, right?
In our case, things started fail because we had a testing setup without a lock file, so it took the latest deps and we wrongly still were using the
devtoolsstuff (which is still on v8 because not supported anymore) with the rest of wdio v9 pakcages, so part of the conflict came from that. However, after removing thedevtoolsstuff, we also had thatcucumberrelated error, so something else along the internal deps also broke. In our case we just added a lockfile with older deps to avoid the error.Canāt really share a repro build as the setup is complicated to extract, sorry for that.
I still doubt that because the puppeteer error shows up only when you have chromedriver or devtools as a service, if we remove the services , then for me its showing up ācucumberā related error Couldnāt initialize ā@wdio/cucumber-frameworkā. TypeError: (0 , class_transformer_1.Type) is not a function
I recommend to look into your
node_modulesdirectory directly to see where the import fails. See the stack trace:So some package, either Puppeteer or proxy agent import the
debugpackage with a wrong version.I assume this happened due to a release in Cucumber that has downstream breaking changes.
@Vinodkomeershetty Here iāve initialized a new wdio - cucumber project and I have the error from the description
And here is my original error related to ā@wdio/devtools-serviceā. Yesterday it was working perfectly fine, today suddenly all tests fail locally and in CI
So I fight with these error whole day and still no luck. It happened not only to me, but, as I said, in CI as well and for all team mates as well(after node-modules reinstallation)