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.

[BUG] The requested module '@playwright/test' does not provide an export named 'request'

See original GitHub issue

Context:

  • 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:closed
  • Created a year ago
  • Reactions:3
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
mxschmittcommented, Apr 6, 2022

@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@next

0reactions
pgooscommented, Jun 23, 2022

Was there an issue created for FullConfig ? Seems it’s happening for me with 1.22

Read more comments on GitHub >

github_iconTop 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 >

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