question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use `.ts` extension when creating Playwright config for TypeScript projects

See original GitHub issue

Describe the bug

I’ve seen a few reports of this. It appears to have been a known issue when the feature was added: https://github.com/sveltejs/kit/pull/4056#discussion_r813166060

I saw that someone fixed it by prefixing with some environment variable. Unforunately, I can’t find what that was at the moment

Reproduction

Create TypeScript + Playwright project from wizard

Logs

No response

System Info

latest

Severity

serious, but I can work around it

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
sebastianrothecommented, Mar 14, 2022

Works again with the latest version of Playwright (1.20), which has been released just now.

2reactions
vhscomcommented, Mar 14, 2022

Testing this on the latest versions appears to result in the following issue:

Cannot find package 'url.js' imported from /path/to/node_modules/@sveltejs/kit/dist/chunks/index2.js`

Appears to have started with 1.0.0-next.292 when using PW_EXPERIMENTAL_TS_ESM flag for tests with TypeScript. Backing down to @sveltejs/kit@1.0.0-next.291 and tests are functional again. So something in the 291-292 changeset is conflicting with the experimental TS ESM flag for Playwright in the current stable release of playwright. As a result, if using @sveltejs/kit@1.0.0-next.292 or above, consider installing playwright version 1.20.0 (currently tagged beta) or above, or try the latest nightly release with @playwright/test@next.

You’re using experimental features, so I’ll assume you know how to upgrade and downgrade your version of Node. If the browser window stops opening and tests fail as a result, reinstall playwright with npx playwright install.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set up your test automation project with Playwright using ...
We will quickly create a tsconfig.json file (in root folder), to use better the TS features and avoid some JS syntax errors which...
Read more >
Getting started with Playwright with Jest and TypeScript
We'll cover how to get up and running with Playwright using Jest as the test runner and how to set up the project...
Read more >
Advanced: configuration | Playwright - CukeTest
Projects. Playwright Test supports running multiple test projects at the same time. This is useful for running the same tests in multiple configurations....
Read more >
Documentation - Migrating from JavaScript - TypeScript
During our JS to TS migration, we'll need to separate our input files to prevent ... TypeScript uses a file called tsconfig.json for...
Read more >
typescript - Playwright: "No named projects are specified in the ...
I moved the Playwright config to the project root folder and it seems to be working now.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found