adaltas / adaltas/node-csv

Build fails in CI "Property 'on' does not exist on type 'Parser'"

Open
#357 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Looking for volunteers
Dominant language
JavaScript
Stars
4.3k
Forks
299
Avg merge
16h 19m
Merged PRs (30d)
1

Description

Describe the bug

When using the csv library for a frontend app with Vue, I get build errors on multiple CI environments. When running the build command locally, it's working fine. In all CI environments I tried (Github Actions, Azure Pipelines, Cloudflare Pages), I get an error when runnung npm run build

src/services/my-parser.ts(61,16): error TS2339: Property 'on' does not exist on type 'Parser'.
src/services/my-parser.ts(63,37): error TS2339: Property 'read' does not exist on type 'Parser'.
src/services/my-parser.ts(68,16): error TS2339: Property 'on' does not exist on type 'Parser'.
src/services/my-parser.ts(73,16): error TS2339: Property 'on' does not exist on type 'Parser'.

To Reproduce

I made a Vue Project with Vite as build system using pnpm create vite my-vue-app --template vue-ts. I tried using 'csv@6.2.0' as well as ' csv-parse@5.3.0'.

I use import according to docs from csv-parse/browser/esm and then use the parse() and parser.on() as well as parser.read()

Additional context

Locally, the build works regardless. I tried using pnpm as well as npm without success

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Vue/Vite TypeScript build using the imports from csv-parse/browser/esm and the parser usage shown in src/services/my-parser.ts around lines 61-73. Start with npm run build in a clean CI-like install, then compare the generated Parser type with the local build. Done means the reported CI errors no longer occur for parser.on and parser.read.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript, vite
Domain
build-system, ci-cd, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.