Skip to content

fix(sqlish): Address TypeError in simpleMarkup formatter#116063

Draft
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix-sqlish-typeerror
Draft

fix(sqlish): Address TypeError in simpleMarkup formatter#116063
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix-sqlish-typeerror

Conversation

@sentry
Copy link
Copy Markdown
Contributor

@sentry sentry Bot commented May 21, 2026

The TypeError: tokens.forEach is not a function was observed in a CI pull request environment, specifically within a local re-implementation of the SQLishFormatter and its simpleMarkup formatter. The root cause was identified as a mismatch between the expected input type of tokens (an array) by the simpleMarkup formatter and the actual return type of this.parser.parse(sql) (a non-array object).

This fix addresses the issue by ensuring that the simpleMarkup formatter receives an iterable array of tokens. It defensively normalizes the output of this.parser.parse(sql) into an array before passing it to simpleMarkup, thus preventing the TypeError when forEach is called.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Fixes JEST-2R49

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants