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

Default param in allowToAddNetwork to object #500

Merged
merged 1 commit into from
Sep 14, 2022

Conversation

roninjin10
Copy link
Contributor

@roninjin10 roninjin10 commented Sep 14, 2022

I have noticed a bug from this pr 6525469 that breaks addAndSwitchNetwork

CypressError: `cy.task('allowMetamaskToAddAndSwitchNetwork')` failed with the following error:

> Cannot destructure property 'waitForEvent' of 'undefined' as it is undefined.

https://on.cypress.io/api/task
      at <unknown> (http://localhost:3000/__cypress/runner/cypress_runner.js:145679:78)
      at tryCatcher (http://localhost:3000/__cypress/runner/cypress_runner.js:11318:23)
      at Promise._settlePromiseFromHandler (http://localhost:3000/__cypress/runner/cypress_runner.js:9253:31)
      at Promise._settlePromise (http://localhost:3000/__cypress/runner/cypress_runner.js:9310:18)
      at Promise._settlePromise0 (http://localhost:3000/__cypress/runner/cypress_runner.js:9355:10)
      at Promise._settlePromises (http://localhost:3000/__cypress/runner/cypress_runner.js:9431:18)
      at _drainQueueStep (http://localhost:3000/__cypress/runner/cypress_runner.js:6025:12)
      at _drainQueue (http://localhost:3000/__cypress/runner/cypress_runner.js:6018:9)
      at ../../node_modules/bluebird/js/release/async.js.Async._drainQueues (http://localhost:3000/__cypress/runner/cypress_runner.js:6034:5)
      at Async.drainQueues (http://localhost:3000/__cypress/runner/cypress_runner.js:5904:14)
  From Your Spec Code:
      at Context.eval (webpack:///./support/commands.js:151:0)
  
  From Node.js Internals:
    TypeError: Cannot destructure property 'waitForEvent' of 'undefined' as it is undefined.
        at Object.allowToAddNetwork (/Users/willcory/gateway/node_modules/@synthetixio/synpress/commands/metamask.js:692:31)
        at Object.allowToAddAndSwitchNetwork (/Users/willcory/gateway/node_modules/@synthetixio/synpress/commands/metamask.js:736:26)
        at allowMetamaskToAddAndSwitchNetwork (/Users/willcory/gateway/node_modules/@synthetixio/synpress/plugins/index.js:211:38)
        at invoke (/Users/willcory/Library/Caches/Cypress/10.8.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:202:32)
        at <unknown> (/Users/willcory/Library/Caches/Cypress/10.8.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/util.js:58:20)
        at tryCatcher (/Users/willcory/Library/Caches/Cypress/10.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
        at Function.Promise.attempt.Promise.try (/Users/willcory/Library/Caches/Cypress/10.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/method.js:39:29)
        at Object.wrapChildPromise (/Users/willcory/Library/Caches/Cypress/10.8.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/util.js:57:27)
        at RunPlugins.taskExecute (/Users/willcory/Library/Caches/Cypress/10.8.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:206:14)
        at RunPlugins.execute (/Users/willcory/Library/Caches/Cypress/10.8.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:139:29)
        at EventEmitter.<anonymous> (/Users/willcory/Library/Caches/Cypress/10.8.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:221:19)
        at EventEmitter.emit (node:events:513:28)
        at EventEmitter.emit (node:domain:489:12)
        at process.<anonymous> (/Users/willcory/Library/Caches/Cypress/10.8.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/util.js:32:33)
        at process.emit (node:events:513:28)
        at process.emit (node:domain:489:12)
        at process.emit.sharedData.processEmitHook.installedValue (/Users/willcory/Library/Caches/Cypress/10.8.0/Cypress.app/Contents/Resources/app/node_modules/@cspotcode/source-map-support/source-map-support.js:745:40)
        at process.el [as emit] (/Users/willcory/gateway/node_modules/playwright-core/lib/utilsBundleImpl.js:14:10319)
        at emit (node:internal/child_process:937:14)
        at processTicksAndRejections (node:internal/process/task_queues:83:21)

@drptbl drptbl merged commit 7fba74d into Synthetixio:dev Sep 14, 2022
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

Successfully merging this pull request may close these issues.

2 participants