good-first-issue-finder
good-first-issue-finder copied to clipboard
Playwright tests cannot be run due to an unknown file extension ".ts"
Description
I am getting the following error when running the playwright test scripts for playwright.config.ts file.
Error: TypeError: Unknown file extension ".ts" for /good-first-issue-finder/playwright.config.ts. at new NodeError (node:internal/errors:370:5) at Loader.defaultGetFormat [as _getFormat] (node:internal/modules/esm/get_format:71:15) at Loader.getFormat (node:internal/modules/esm/loader:105:42) at Loader.getModuleJob (node:internal/modules/esm/loader:243:31) at Loader.import (node:internal/modules/esm/loader:177:17) at importModuleDynamicallyWrapper (node:internal/vm/module:437:15)
Screenshots
No response
Additional information
No response
Could you confirm what platform you are on and what version of nodejs you are using? Also can you share the steps you took to get here? For example...
- cloned repo
- ran the command
npm install - ...
Test-files need to have the extension .spec.ts to get picked up by playwright.
Could you please describe the reproduction steps Eddie mentioned above.
OS - macOS Nodejs version - v16.5.0
Steps followed:
- Fork the project
- Clone the repo on my local machine
- Run npm install then npx playwright install --with-deps
- Then, when I tried running the test using npm run test, I got the aforementioned error.
Note - test file type is already have extension .spec.ts
It appears that the issue is in the package.json file. Would it be okay if I send the PR for the fix? @eddiejaoude
Sure 👍 It is easier to see the changes and discuss when there is a PR 👍
BTW @Cahllagerfeld is the project lead on this project.