Finding selector/locator is failing

Dear all!
I failed to find an answer in the net so writing here for the first time:

Need to ensure that selector has appeared and then disappeared during the page load.

Here the code:

import { browser, networkProfiles } from 'k6/experimental/browser';

export const options = {
  scenarios: {
    ui: {
      executor: 'shared-iterations',
      options: {
        browser: {
          type: 'chromium',
        },
      },
    },
  },
}

export default async function () {
  const page = browser.newPage();

  try {
 

    await page.goto('https://companysite.com/sportsbook/sidebar');
      const ready = page.locator('[data-editor-id="pageLoader"]');
      ready.waitFor({state : 'attached'});
      ready.waitFor({state : 'detached'});

    page.screenshot({ path: 'screenshots/screenshot.png' });
  } finally {
    page.close();
  }
}

Log tells me:
INFO[0010] " selector did not resolve to any element" browser_source=console-api source=browser

Can you please suggest what I am doing wrong?
Also can I refer to the waitForSelector with options and what will be the full syntax for this?

Thanks!
Artem