tastejs/todomvc · error · Error

Cannot determine what kind of selectors this app uses.

Error message

Cannot determine what kind of selectors this app uses.

What it means

Thrown at cypress/e2e/spec.cy.js:513, the final else branch of the same selector-detection block as error 2. It fires when the framework is not in `usesIDSelectors` AND neither `input#new-todo` nor `input.new-todo` can be found anywhere in the document, including inside shadow roots (findDeep walks shadow trees at line 487-495). In practice this means the app never rendered its new-todo input: the page did not load, the build was skipped, the framework threw during boot, or the markup uses a non-standard selector the spec does not recognize.

Source

Thrown at cypress/e2e/spec.cy.js:513

      }
      cy.document().then(doc => {
        if (framework in usesIDSelectors) {
          setSelectors(usesIDSelectors[framework])
          createTodoCommands(usesIDSelectors[framework])
        } else if (findDeep(doc, 'input#new-todo') && findDeep(doc, 'input.new-todo')) {
          throw new Error(
            'Cannot determine what kind of selectors this app uses. Add it to usesIDSelectors.'
          )
        } else if (findDeep(doc, 'input#new-todo')) {
          cy.log('app uses ID selectors')
          setSelectors(true)
          createTodoCommands(true)
        } else if (findDeep(doc, 'input.new-todo')) {
          cy.log('app uses class selectors')
          setSelectors(false)
          createTodoCommands(false)
        } else {
          throw new Error(
            'Cannot determine what kind of selectors this app uses.'
          )
        }
      })
    })

    beforeEach(() => {
      // catch any framework that debounces its localStorage writes
      // and causes items to "appear" in a new test all of the sudden
      hasNoItems()
    })

    afterEach(() => {
      // to detect when a test queued up some operation
      // and it happens AFTER test finishes
      currentTestId = 0
    })

View on GitHub (pinned to ff43b02e59)

Solutions

  1. Confirm the app actually loads: open the same URL Cypress visits in a browser and check the new-todo input is present and focused.
  2. Build the example first (`npm run build` in the framework folder) so dist/ exists for build-step frameworks.
  3. Verify baseUrl in cypress.config.js and the frameworkFolders mapping at line 38 point to the runnable index.html.
  4. If the app legitimately uses a non-standard selector, add the framework to `usesIDSelectors` at line 132 AND extend the idSelectors/classSelectors maps so the chosen style has the right query.
  5. Check the browser console / Cypress command log for a framework boot error that prevented the input from rendering.
Defensive patterns

Strategy: validation

Validate before calling

// Assert the app booted before selector detection runs, so a load failure
// surfaces as a clear assertion instead of the generic 'cannot determine' throw.
cy.document().then(doc => {
  const hasAnyInput = findDeep(doc, 'input')
  if (!hasAnyInput) {
    throw new Error(`App at ${Cypress.config('baseUrl')} rendered no <input>; build missing or wrong URL.`)
  }
})

Prevention

When it happens

Trigger: Cypress visited a URL that returned a 404 or a blank page; the example's build output (dist/) was never produced so baseUrl serves nothing; the framework's JS errored on boot so the input was never created; the app renders the input under a different selector (e.g. a custom element name) that matches neither convention; a timing issue where the document is queried before the framework has hydrated (though `cy.document().then(...)` yields after load, slow hydration can still lose the race).

Common situations: Forgot `npm run build` for a build-step framework (angular, react, vue, lit, svelte all land in dist/ per frameworkFolders at line 38); baseUrl or framework folder mapping is wrong so the wrong page loads; a new example with bespoke markup; a framework boot error swallowed by the app but visible as a missing input; shadow-DOM app where findDeep's recursive walk misses a closed shadow root.

Related errors


AI-assisted analysis of tastejs/todomvc@ff43b02e59 (2026-08-13). Data as JSON: /api/errors/bc9eaeed293d7377. Report an issue: GitHub.