synpress icon indicating copy to clipboard operation
synpress copied to clipboard

[๐Ÿ› Bug]: Building Next.js app throws error

Open enesozturk opened this issue 1 year ago โ€ข 1 comments

๐Ÿ”Ž Have you searched existing issues to avoid duplicates?

  • [X] I have made sure that my issue is not a duplicate.

๐Ÿงช Have you tested your code using latest version of Synpress?

๐Ÿ’ก Are you able to provide enough information to be able to reproduce your issue locally?

  • [X] I can provide enough details to reproduce my issue on local environment.

Synpress version

4.0.0-alpha.7

Node.js version

21.6.2

Operating system

macOS

Run mode

Playwright + Synpress (as plugin)

CI platform (if applicable)

No response

Are you running your tests inside docker? (if applicable)

  • [ ] This issue could be related to docker.

What happened?

We are using Playwright for our Next.js app. I've used Synpress v4 and made the initial setup working. But when I build my app, I'm getting the following error:

../../node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@synthetixio/synpress-metamask/src/fixtures/metaMaskFixtures.ts:56:23
Type error: Property 'HEADLESS' comes from an index signature, so it must be accessed with ['HEADLESS'].

  54 |       const browserArgs = [`--disable-extensions-except=${metamaskPath}`]
  55 |
> 56 |       if (process.env.HEADLESS) {
     |                       ^
  57 |         browserArgs.push('--headless=new')
  58 |
  59 |         if (slowMo > 0) {

What is your expected behavior?

Build the Next.js app as expected

How to reproduce the bug.

Relevant log output

-

enesozturk avatar Jul 31 '24 16:07 enesozturk