Skip to content

CommonJS exports.X = async () => {} route handlers aren't indexed as symbols #1675

Description

@azorlu80

Version: v1.6.0

Handlers written as exports.foo = () => {} / exports.foo = async () => {} (a very common Express/CommonJS controller style) don't seem to be indexed as function nodes. node/callers can't find them, and calls into them collapse to file level (the calling function is lost).

Repro:

  1. controller.js:
    exports.getItems = async (req, res) => { /* ... */ };
    wired in a router: router.get('/items', getItems)
  2. codegraph node getItems"Symbol not found", although it's a real, route-wired handler.

Impact: in one real Express codebase, 60+ route handlers written in this style are invisible to the graph, so impact/callers analysis silently misses them.

Ask: index the exports.<name> = (arrow | async arrow | function) assignment form as a function node — the same treatment const X = () => {} already gets.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions