[BUG] The requested module '@playwright/test' does not provide an export named 'request'
See original GitHub issueContext:
- Playwright Version: “@playwright/test”: “1.20.1”,
- Operating System: mac
- Node.js version: 16.13.1
- Browser: N/A
- Extra: [any specific details about your environment]
Code Snippet
// global-setup.ts
import { chromium, expect, request, type FullConfig } from '@playwright/test';
Describe the bug
I am using vite / esm, and it seems that request is not exported by @playwright/test/index.mjs. I am attempting to follow the docs here: https://playwright.dev/docs/test-auth#sign-in-via-api-request, but I get:
import { chromium, expect, request } from '@playwright/test';
^^^^^^^
SyntaxError: The requested module '@playwright/test' does not provide an export named 'request'
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Error: Cannot find module '@playwright/test'
The test works fine without this: const { expect } = require('@playwright/test'); const { matchers } = require('playwright-expect'); console. ...
Read more >fix(playwright-test): have the proper default export (#7328)
There are 3 ways to import `@playwright/test` library in the modern Node.js ... we had no default export (`export *` syntax does not...
Read more >playwright-test
Start using playwright-test in your project by running `npm i playwright-test`. There are 3 other projects in the npm registry using ...
Read more >Configuring Jest
All modules used in your tests will have a replacement ... even if no tests exist for this file and it's never required...
Read more >How To Use Modules in TypeScript
Later on, you will use these sample classes to test out the importing and exporting of code from one program to another. First,...
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

@IanVS this was no regression, thats why we did not cherry-pick it. It will be contained in the 1.21 release, or you can try the nightly today:
npm install -D @playwright/test@nextWas there an issue created for
FullConfig? Seems it’s happening for me with 1.22