stale-optician-85950
08/31/2022, 7:19 PMsetupNodeEvents: async (on, config) => {
... this tells Cypress this is code that does Not run on the browser i.e. query DB
Cypress configuration options are different in that they represent your unique settings for running Cypress. These are key-value pairs i.e experimentalSessionAndOrigin: true, and are documented here https://docs.cypress.io/guides/references/configuration
You can view all your unique settings when running cypress open UI > Settings > Project Settings
That is why moving that configuration flag solved your problem.