webdriverio: [🐛 Bug]: @wdio-junit-reporter does not work on WDIO v8 TypeScript

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

latest

Node.js Version

18

Mode

WDIO Testrunner

Which capabilities are you using?

No response

What happened?

Upgraded to WebdriverIO 8 with TypeScript and the test wont launch, due to junit-reporter cannot be initialized.

What is your expected behavior?

No response

How to reproduce the bug.

Upgrade to WDIO v8 & TypeScript

Execute any test.

Relevant log output

[0-0] 2023-01-04T15:02:10.563Z ERROR @wdio/local-runner: Failed launching test session: Error: Couldn't initialise "@wdio/junit-reporter".
[0-0] ... `node_modules/validator/es/index.js:1`
[0-0] import toDate from './lib/toDate';
[0-0] ^^^^^^
[0-0] 
[0-0] SyntaxError: Cannot use import statement outside a module
[0-0]     at Object.compileFunction (node:vm:352:18)
[0-0]     at wrapSafe (node:internal/modules/cjs/loader:1032:15)
[0-0]     at Module._compile (node:internal/modules/cjs/loader:1067:27)
[0-0]     at Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
[0-0]     at Object.require.extensions.<computed> [as .js] (... node_modules/ts-node/src/index.ts:1608:43)
[0-0]     at Module.load (node:internal/modules/cjs/loader:981:32)
[0-0]     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
[0-0]     at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:168:29)
[0-0]     at ModuleJob.run (node:internal/modules/esm/module_job:197:25)
[0-0]     at async Promise.all (index 0)
[0-0]     at safeImport (file:///.../node_modules/@wdio/utils/build/utils.js:210:15)
[0-0]     at async initialisePlugin (file:///.../node_modules/@wdio/utils/build/initialisePlugin.js:25:26)
[0-0]     at async BaseReporter._loadReporter (file:///.../node_modules/@wdio/runner/build/reporter.js:178:30)
[0-0]     at async Promise.all (index 2)
[0-0]     at async BaseReporter.initReporters (file:///.../node_modules/@wdio/runner/build/reporter.js:23:27)
[0-0]     at async Runner.run (file:///.../node_modules/@wdio/runner/build/index.js:68:9)
[0-0] /.../node_modules/validator/es/index.js:1


### Code of Conduct

- [X] I agree to follow this project's Code of Conduct

### Is there an existing issue for this?

- [X] I have searched the existing issues

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 25 (11 by maintainers)

Most upvoted comments

@nair-sumesh if you define a outputFileFormat you have to make sure that the filename is different for every worker. This is why you have the options parameter. I recommend not to use the option since your name is similar to the default name.