Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm run wdio - throws Must use import to load ES Module: throws #27

Open
howdoilearn opened this issue Aug 4, 2024 · 2 comments
Open

Comments

@howdoilearn
Copy link

npm run wdio

of ES modules is not supported.
require() of /Users/testuser/git/component-testing-examples/react-typescript-vite/wdio.conf.ts from /Users/testuser/git/component-testing-examples/react-typescript-vite/node_modules/@wdio/cli/node_modules/@wdio/config/build/lib/FileSystemPathService.js is an ES module file as it is a .ts file whose nearest parent package.json contains "type": "module" which defines all .ts files in that package scope as ES modules.

@christian-bromann
Copy link
Member

@howdoilearn thanks for raising an issue, mind providing a minimal reproducible example? It seems like a configuration issue.

@howdoilearn
Copy link
Author

I just followed the instructions at - https://github.com/webdriverio/component-testing-examples

After I cloned the repo, I followed the instructions:-

"Switch to the desired example directory"

cd ./
I switched to - react-typescript-vite (there is no additional read me here so I followed the instructions in the main readme)

"Install dependencies" /*this is fine */

npm install

Run WebdriverIO tests:
This gives the "FileSystemPathService.js is an ES module file as it is a .ts file whose nearest parent package.json contains "type": "module" which defines all .ts files in that package scope as ES modules."

npm run wdio

It is related to Typescript I am running component testing using wdio of js - for example there is no issue with the set up instructions and execution for - component-testing/svelte-example.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants