Skip to content

Fix legacy CSV parsing of leading empty columns - #5961

Merged
dceejay merged 1 commit into
node-red:mainfrom
sankalpsthakur:fix/issue-5929-csv-leading-empty
Sep 18, 2026
Merged

dceejay merged 1 commit into
node-red:mainfrom
sankalpsthakur:fix/issue-5929-csv-leading-empty

Conversation

@sankalpsthakur

Copy link
Copy Markdown
Contributor
  • Bugfix (non-breaking change which fixes an issue)
  • New feature

Proposed changes

Fixes #5929. Thanks to codeCraft-Ritik for the report and bunnysayzz for the diagnosis in the issue.

Handle a delimiter at offset zero before reading the preceding character. Check LF and CR explicitly instead of passing a second string to includes.

Adds 17 regressions covering comma/tab delimiters, LF/CRLF/CR endings, null inclusion, consecutive empty columns, missing final newline and quoted empty fields. The RFC parser and existing blank-row behavior are unchanged.

Validation

Before/after and full-suite run, Node 22 and 24 on Linux:

  • Unchanged parser: 15 new cases fail with the reported TypeError; the two quoted-empty controls pass.
  • Fixed parser: all 17 cases pass.
  • npm run test: 2,864 passing, 60 pending on each Node version; includes build, dependency checks, lint and coverage.
  • git diff --check passes.

AI tools assisted with implementation, validation and this description.

@dceejay

dceejay commented Sep 18, 2026

Copy link
Copy Markdown
Member

Excellent fix - thanks for the PR, especially the extra tests !

@dceejay
dceejay merged commit 1e85f1e into node-red:main Sep 18, 2026
3 checks passed
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.

CSV node crashes with TypeError: Cannot read properties of undefined (reading 'includes') when CSV starts with delimiter

2 participants