[BUG] svelte + 1.18.0-alpha: SyntaxError: The requested module '@playwright/test' does not provide an export named 'PlaywrightTestConfig'
See original GitHub issueContext:
- Playwright Version: @playwright/test@1.18.0-alpha-jan-10-2022
- Operating System: Linux
- Node.js version: v16.13.2
- Browser: <didn’t reach this part>
- Extra:
System:
- OS: Linux 5.15 NixOS 22.05 (Quokka) 22.05 (Quokka)
- Memory: 740.97 MB / 15.51 GB
- Container: Yes
Binaries:
- Node: 16.13.2 - /nix/store/1s5l90kdzz5ii4bafi2dnyzv3smziq49-nodejs-16.13.2/bin/node
- npm: 8.1.2 - /nix/store/1s5l90kdzz5ii4bafi2dnyzv3smziq49-nodejs-16.13.2/bin/npm
Languages:
- Bash: 5.1.12 - /run/current-system/sw/bin/bash
Code Snippet
# Skeleton project, Typescript, Eslint, Prettier
npm init svelte@next svelte-playwright
cd svelte-playwright
npm install
# Typescript, "tests", true, false
npm init playwright
npx playwright test
I get: Error: playwright.config.ts: Cannot import a typescript file from an esmodule.
try 1.18.0-alpha:
npm i --save-dev @playwright/test@1.18.0-alpha-jan-10-2022
PW_EXPERIMENTAL_TS_ESM=1 npx playwright test
I get:
(node:62468) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Using config at /home/bbigras/dev/svelte-playwright/playwright.config.ts
file:///home/bbigras/dev/svelte-playwright/playwright.config.ts:1
import { PlaywrightTestConfig, devices } from '@playwright/test';
^^^^^^^^^^^^^^^^^^^^
SyntaxError: The requested module '@playwright/test' does not provide an export named 'PlaywrightTestConfig'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
at ModuleJob.run (node:internal/modules/esm/module_job:181:5)
at async Promise.all (index 0)
at ESMLoader.import (node:internal/modules/esm/loader:281:24)
at importModuleDynamicallyWrapper (node:internal/vm/module:437:15)
at Loader._requireOrImport (/home/bbigras/dev/svelte-playwright/node_modules/@playwright/test/lib/loader.js:260:28)
at Loader.loadConfigFile (/home/bbigras/dev/svelte-playwright/node_modules/@playwright/test/lib/loader.js:77:18)
at loadConfig (/home/bbigras/dev/svelte-playwright/node_modules/@playwright/test/lib/runner.js:91:24)
at loadConfigFromDirectory (/home/bbigras/dev/svelte-playwright/node_modules/@playwright/test/lib/runner.js:98:24)
at Runner.loadConfigFromFile (/home/bbigras/dev/svelte-playwright/node_modules/@playwright/test/lib/runner.js:107:22)
at runTests (/home/bbigras/dev/svelte-playwright/node_modules/@playwright/test/lib/cli.js:148:18)
at Command.<anonymous> (/home/bbigras/dev/svelte-playwright/node_modules/@playwright/test/lib/cli.js:73:7)
Describe the bug
maybe related to #7121
Same thing with v1.18.1
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:18 (3 by maintainers)
Top Results From Across the Web
Jest, ES6 modules "does not provide export named"
The problem I have is that my app is built with ES6 modules and Jest ES6 modules is experimental and it seems that...
Read more >dgozman - npm
A customizable test framework to build your own test frameworks. Foundation for the [Playwright test runner](https://github.com/microsoft/playwright-test).
Read more >Why Playwright instead of Cypress : r/sveltejs - Reddit
There are several differences between the two, but my guess is because Cypress doesn't support Webkit-based browsers and has an imperative ...
Read more >JavaScript Daily on Twitter: "Playwright Can Now Test React ...
Playwright Can Now Test React, Vue.js or Svelte Components: github.com. Release v1.22.0 · microsoft/playwright.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Typescript and ESM are not yet best friends, replace first line with:
I am now receiving this error after upgrading from 1.17.2 to 1.19.2
If I alter file
node_modules/@playwright/test/lib/loader.js
then it starts working again.
Also using the generated playwright.config.ts file does not resolve this issue.