Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Playwright CT 1.43.1 throws Vite/Rollup error when testing MUI #30589

Closed
PanchoutNathan opened this issue Apr 29, 2024 · 1 comment
Closed

Comments

@PanchoutNathan
Copy link

PanchoutNathan commented Apr 29, 2024

Version

1.43.1

Steps to reproduce

import { test } from "@playwright/experimental-ct-react";
import { TextField } from "@mui/material";

test("this test causes vite/rollup failure", async ({ mount }) => {
await mount();
});

Expected behavior

Test builds and executes

Actual behavior

Error: [vite]: Rollup failed to resolve import "undefined" from "/Users/nathanpanchout/Documents/Societe/Clients/FunMooc/joanie/src/frontend/admin/playwright/index.tsx".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`

    at viteWarn (/Users/nathanpanchout/Documents/Societe/Clients/FunMooc/joanie/src/frontend/admin/node_modules/vite/dist/node/chunks/dep-DkOS1hkm.js:67620:27)
    at onwarn (/Users/nathanpanchout/Documents/Societe/Clients/FunMooc/joanie/src/frontend/admin/node_modules/@vitejs/plugin-react/dist/index.mjs:250:9)
    at onRollupWarning (/Users/nathanpanchout/Documents/Societe/Clients/FunMooc/joanie/src/frontend/admin/node_modules/vite/dist/node/chunks/dep-DkOS1hkm.js:67645:9)
    at onwarn (/Users/nathanpanchout/Documents/Societe/Clients/FunMooc/joanie/src/frontend/admin/node_modules/vite/dist/node/chunks/dep-DkOS1hkm.js:67364:13)
    at /Users/nathanpanchout/Documents/Societe/Clients/FunMooc/joanie/src/frontend/admin/node_modules/rollup/dist/es/shared/node-entry.js:18351:13
    at Object.logger (/Users/nathanpanchout/Documents/Societe/Clients/FunMooc/joanie/src/frontend/admin/node_modules/rollup/dist/es/shared/node-entry.js:19999:9)
    at ModuleLoader.handleInvalidResolvedId (/Users/nathanpanchout/Documents/Societe/Clients/FunMooc/joanie/src/frontend/admin/node_modules/rollup/dist/es/shared/node-entry.js:18941:26)
    at ModuleLoader.resolveDynamicImport (/Users/nathanpanchout/Documents/Societe/Clients/FunMooc/joanie/src/frontend/admin/node_modules/rollup/dist/es/shared/node-entry.js:18999:58)
    at /Users/nathanpanchout/Documents/Societe/Clients/FunMooc/joanie/src/frontend/admin/node_modules/rollup/dist/es/shared/node-entry.js:18886:32

Additional context

It's exactly the same problem as here: #29854.

However even with 1.43.1, the problem still seems to persist on my side, sorry

Environment

System:
    OS: macOS 14.4.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 104.80 MB / 16.00 GB
  Binaries:
    Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v20.9.0/bin/yarn
    npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
  Languages:
    Bash: 3.2.57 - /bin/bash
  npmPackages:
    @playwright/experimental-ct-react: 1.43.1 => 1.43.1 
    @playwright/test: 1.43.1 => 1.43.1
@dgozman
Copy link
Contributor

dgozman commented Apr 29, 2024

#29854 has just been fixed, and the fix will be released as a part of v1.44. You can try a canary release for now.

@dgozman dgozman closed this as completed Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants