Skip to content

TypeError: Cannot read properties of undefined (reading 'length') #61867

Closed as not planned

Description

@ntdiary

🔎 Search Terms

"constructor"

🕗 Version & Regression Information

⏯ Playground Link

https://www.typescriptlang.org/play/?ts=5.8.3#code/MYGwhgzhAECC0G8BQ1oHJgHsB2EAuATgK7B6YFoAUAlItAL5KNa57RjQC802ApgO5waSFhEwheAOhCYA5pTCTRhEmQLUgA

💻 Code

class A {
  'constructor'() { }
}
const a = new A()
console.log(a.constructor)

🙁 Actual behavior

Open the console and place the cursor on the constructor in the last line, will throw this error:

🙂 Expected behavior

No error is expected

Additional information about the issue

const str = node as StringLiteralLike;
return str.text.length === searchSymbolName.length && (

Here, str is a TokenObject, it doesn't have a text property.

Activity

  1. added
    Domain: LS: Symbol Navigation
    on Oct 15, 2025
  2. locked as resolved and limited conversation to collaborators on Dec 3, 2025
  3. RyanCavanaugh commented on Dec 3, 2025

    @RyanCavanaugh
    Member

    Closing language service bugs related to the 6.0 implementation. For more information, see #62827

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    7.0 LS MigrationBugDomain: LS: Symbol Navigation

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions