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
I recently upgraded the node and libraries on our CI and getting the following error (when using teamcity reporter):
[0-0] 2022-12-29T10:06:50.764Z ERROR @wdio/local-runner: Failed launching test session: Error: Couldn't initialise "wdio-teamcity-reporter".
[0-0] Error [ERR_REQUIRE_ESM]: require() of ES Module /usr/lib/node_modules/@wdio/reporter/build/index.js from /usr/lib/node_modules/wdio-teamcity-reporter/index.js not supported.
[0-0] Instead change the require of /usr/lib/node_modules/@wdio/reporter/build/index.js in /usr/lib/node_modules/wdio-teamcity-reporter/index.js to a dynamic import() which is available in all CommonJS modules.
[0-0] at Object.<anonymous> (/usr/lib/node_modules/wdio-teamcity-reporter/index.js:1:22)
[0-0] at async Promise.all (index 0)
[0-0] at async safeImport (file:///usr/lib/node_modules/@wdio/local-runner/node_modules/@wdio/utils/build/utils.js:188:21)
[0-0] at async initialisePlugin (file:///usr/lib/node_modules/@wdio/local-runner/node_modules/@wdio/utils/build/initialisePlugin.js:32:20)
[0-0] at async BaseReporter._loadReporter (file:///usr/lib/node_modules/@wdio/local-runner/node_modules/@wdio/runner/build/reporter.js:178:30)
[0-0] at async Promise.all (index 0)
[0-0] at async BaseReporter.initReporters (file:///usr/lib/node_modules/@wdio/local-runner/node_modules/@wdio/runner/build/reporter.js:23:27)
[0-0] at async Runner.run (file:///usr/lib/node_modules/@wdio/local-runner/node_modules/@wdio/runner/build/index.js:68:9)
[0-0] at safeImport (file:///usr/lib/node_modules/@wdio/local-runner/node_modules/@wdio/utils/build/utils.js:210:15)
[0-0] at async initialisePlugin (file:///usr/lib/node_modules/@wdio/local-runner/node_modules/@wdio/utils/build/initialisePlugin.js:32:20)
[0-0] at async BaseReporter._loadReporter (file:///usr/lib/node_modules/@wdio/local-runner/node_modules/@wdio/runner/build/reporter.js:178:30)
[0-0] at async Promise.all (index 0)
[0-0] at async BaseReporter.initReporters (file:///usr/lib/node_modules/@wdio/local-runner/node_modules/@wdio/runner/build/reporter.js:23:27)
[0-0] at async Runner.run (file:///usr/lib/node_modules/@wdio/local-runner/node_modules/@wdio/runner/build/index.js:68:9)
[0-0] FAILED
I tried replacing require with import statements and that giving not a module error..
Am I missing any other dependency here?
The text was updated successfully, but these errors were encountered:
This is because @wdio/reporter is listed within dev dependencies while it should actually be a dependency. This way it would correctly require the v7 reporter package and doesn't fail because it tries to require the v8 ESM package.
Two things need to be done:
rewrite the package to ESM (optional but needs to be done eventually)
node version: v18.12.1
wdio version: 8.0.15
I recently upgraded the node and libraries on our CI and getting the following error (when using teamcity reporter):
I tried replacing require with import statements and that giving not a module error..
Am I missing any other dependency here?
The text was updated successfully, but these errors were encountered: