3

@solana/web3.js import error when launching cypress. And on windows everything works fine, but on MacOS an error appears

./node_modules/@solana/web3.js/lib/index.browser.esm.js 1976:27
Module parse failed: Unexpected token (1976:27)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|   if (transaction.recentBlockhash != null && transaction.lastValidBlockHeight != null) {
|     status = (await connection.confirmTransaction({
>       abortSignal: options?.abortSignal,
|       signature: signature,
|       blockhash: transaction.recentBlockhash
4
  • I think, you have to update your node-modules to latest version. Run this command: 'yarn upgrade-interactive' Commented Mar 10, 2023 at 2:28
  • @DoublersKay Unfortunately it didn't help
    – bluewater
    Commented Mar 10, 2023 at 12:56
  • 1
    The problem was solved by changing the version of @solana/web3.js from version 17.3.3 to version 17.3.0
    – bluewater
    Commented Mar 10, 2023 at 19:14
  • Great, Thanks for letting me know Commented Mar 10, 2023 at 19:27

1 Answer 1

1

The error indicates a problem with this line:

options?.abortSignal

This is the optional chaining operator.

Your solution will require convincing Cypress to parse this syntax. Seek advice from others having the same trouble, here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.