synpress icon indicating copy to clipboard operation
synpress copied to clipboard

[๐Ÿ› Bug]: `es5` target for `compilerOptions` fails

Open PatrickAlphaC opened this issue 9 months ago โ€ข 2 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.5

Node.js version

23.5.0

Operating system

macOS 15.3

Run mode

Synpress (standalone)

CI platform (if applicable)

No response

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

  • [ ] This issue could be related to docker.

What happened?

I'm trying to run:

pnpm exec playwright test

But, I'm running into the error of:

Error: Cache for xx does not exist. Create it first!

So, I am now trying to create the cache:

(I first had to install @swc/core)

pnpm synpress ./e2e/wallet-setup

But getting:

% pnpm synpress ./e2e/wallet-setup
โš ๏ธ The CLI is in alpha so expect breaking changes! โš ๏ธ

๐Ÿš€ Building the cache for wallet setup functions... ๐Ÿš€

Aborting...
Error: Transform failed with 1 error:
<stdin>:1:8: ERROR: Expected identifier but found "("
    at failureErrorWithLog (/Path/code/tsender-ui/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1651:15)
    at /Path/code/tsender-ui/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:849:29
    at responseCallbacks.<computed> (/Path/code/tsender-ui/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:704:9)
    at handleIncomingPacket (/Path/code/tsender-ui/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:764:9)
    at Socket.readFromStdout (/Path/code/tsender-ui/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:680:7)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
    at Readable.push (node:internal/streams/readable:390:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:189:23) {
  errors: [
    {
      detail: undefined,
      id: '',
      location: [Object],
      notes: [],
      pluginName: '',
      text: 'Expected identifier but found "("'
    }
  ],
  warnings: []
}

What is your expected behavior?

I think it's supposed to make a cache?

How to reproduce the bug.

  1. Create a basic.setup.ts
import { defineWalletSetup } from '@synthetixio/synpress'
import { MetaMask } from '@synthetixio/synpress/playwright'

const SEED_PHRASE = 'test test test test test test test test test test test junk'
const PASSWORD = 'SynpressIsAwesomeNow!!!'

export default defineWalletSetup(PASSWORD, async (context, walletPage) => {
    const metamask = new MetaMask(context, walletPage, PASSWORD)

    await metamask.importWallet(SEED_PHRASE)
})
  1. Create a cache
pnpm synpress ./e2e/wallet-setup

You'll get this error

Relevant log output

% pnpm synpress ./e2e/wallet-setup
โš ๏ธ The CLI is in alpha so expect breaking changes! โš ๏ธ

๐Ÿš€ Building the cache for wallet setup functions... ๐Ÿš€

Aborting...
Error: Transform failed with 1 error:
<stdin>:1:8: ERROR: Expected identifier but found "("
    at failureErrorWithLog (/Path/code/tsender-ui/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1651:15)
    at /Path/code/tsender-ui/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:849:29
    at responseCallbacks.<computed> (/Path/code/tsender-ui/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:704:9)
    at handleIncomingPacket (/Path/code/tsender-ui/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:764:9)
    at Socket.readFromStdout (/Path/code/tsender-ui/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:680:7)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
    at Readable.push (node:internal/streams/readable:390:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:189:23) {
  errors: [
    {
      detail: undefined,
      id: '',
      location: [Object],
      notes: [],
      pluginName: '',
      text: 'Expected identifier but found "("'
    }
  ],
  warnings: []
}

EDIT

We have identified the issue, see the new reproduction steps:

https://github.com/Synthetixio/synpress/issues/1264#issuecomment-2654173015

PatrickAlphaC avatar Feb 12 '25 14:02 PatrickAlphaC