Skip to content

[Regression]: Importing a non component from external file throws error. #31597

Open
@ritz078

Description

@ritz078

Last Good Version

1.41.2

First Bad Version

1.42.1

Steps to reproduce

When I import anything except a React component from an external file, the test throws following error:

Error: Error: Minified React error #152; visit https://reactjs.org/docs/error-decoder.html?invariant=152&args[]=result for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

    at http://localhost:3100/assets/index-6Bzkpia8.js:467:362
    at fi (http://localhost:3100/assets/index-6Bzkpia8.js:493:171)
    at ck (http://localhost:3100/assets/index-6Bzkpia8.js:585:387)
    at bk (http://localhost:3100/assets/index-6Bzkpia8.js:567:350)
    at ak (http://localhost:3100/assets/index-6Bzkpia8.js:567:279)
    at Tj (http://localhost:3100/assets/index-6Bzkpia8.js:567:138)
    at Lj (http://localhost:3100/assets/index-6Bzkpia8.js:560:164)
    at Jg (http://localhost:3100/assets/index-6Bzkpia8.js:554:175)
    at lk (http://localhost:3100/assets/index-6Bzkpia8.js:602:27)
    at http://localhost:3100/assets/index-6Bzkpia8.js:606:307
    at /Users/ritz078/projects/pw-ct-repro/http:/localhost:3100/assets/index-6Bzkpia8.js:467:362
    at fi (/Users/ritz078/projects/pw-ct-repro/http:/localhost:3100/assets/index-6Bzkpia8.js:493:171)
    at ck (/Users/ritz078/projects/pw-ct-repro/http:/localhost:3100/assets/index-6Bzkpia8.js:585:387)
    at bk (/Users/ritz078/projects/pw-ct-repro/http:/localhost:3100/assets/index-6Bzkpia8.js:567:350)
    at ak (/Users/ritz078/projects/pw-ct-repro/http:/localhost:3100/assets/index-6Bzkpia8.js:567:279)
    at Tj (/Users/ritz078/projects/pw-ct-repro/http:/localhost:3100/assets/index-6Bzkpia8.js:567:138)
    at Lj (/Users/ritz078/projects/pw-ct-repro/http:/localhost:3100/assets/index-6Bzkpia8.js:560:164)
    at Jg (/Users/ritz078/projects/pw-ct-repro/http:/localhost:3100/assets/index-6Bzkpia8.js:554:175)
    at lk (/Users/ritz078/projects/pw-ct-repro/http:/localhost:3100/assets/index-6Bzkpia8.js:602:27)
    at /Users/ritz078/projects/pw-ct-repro/http:/localhost:3100/assets/index-6Bzkpia8.js:606:307
    at mount (/Users/ritz078/projects/pw-ct-repro/node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@playwright/experimental-ct-core/lib/mount.js:50:35)
    at /Users/ritz078/projects/pw-ct-repro/App.spec.tsx:7:29

Expected behavior

I should be able to import variables like arrays, objects etc from the same file I import a React component from.

Actual behavior

When I import anything except a React component from an external file, the test throws error

Additional context

No response

Environment

System:
    OS: macOS 14.0
    CPU: (10) arm64 Apple M1 Max
    Memory: 12.38 GB / 64.00 GB
  Binaries:
    Node: 20.9.0 - ~/.asdf/installs/nodejs/20.9.0/bin/node
    Yarn: 1.22.19 - ~/.asdf/installs/nodejs/20.9.0/bin/yarn
    npm: 10.1.0 - ~/.asdf/plugins/nodejs/shims/npm
    pnpm: 9.5.0 - ~/.asdf/installs/nodejs/20.9.0/bin/pnpm
  Languages:
    Bash: 3.2.57 - /bin/bash
  npmPackages:
    @playwright/experimental-ct-react17: 1.45.1 => 1.45.1 
    @playwright/test: 1.45.1 => 1.45.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions