Skip to content
TS2349

    ↑↓ move · ⏎ open · esc close

    TS2349

    Expression is not callable

    This expression is not callable.

    The compiler’s own words. Not translated — this is the string you pasted into a search box.

    Parentheses are being used as a function call, but the expression has no call signature.

    Reproduction

    const value = 'text'
    
    value()

    The build asserts this emits exactly this code.

    Why the compiler says this

    Only function-like values carry call signatures. A string may have methods, but the string itself is data; adding `()` asks the runtime to execute it as code.

    Fixes

    1. 01
      const value = 'text'
      
      const upper = value.toUpperCase()

      Call the method that performs the intended operation.

    2. 02
      const value = () => 'text'
      
      const text = value()

      If this was meant to be deferred work, store a function rather than its result.

    Takeaway

    Read the type named under the headline: it tells you which non-function value actually reached the call site.

    Where to go next

    Errors