Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
aryobenholzner opened this issue Aug 8, 2022 · 5 comments
Open

Comments

@aryobenholzner
Copy link

aryobenholzner commented Aug 8, 2022

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

@wdavidw
Copy link
Member

wdavidw commented Aug 8, 2022

Sorry but unless you provide me a script replicating the issue, it will be hard for us to investigate.

@aryobenholzner
Copy link
Author

Sorry, I was in a hurry. I now created a sample repo as described https://github.com/aryobenholzner/vue-csv. Notice the github action fails when running npm run build

@aryobenholzner
Copy link
Author

any updates on this? i would really like to use this package in client

@wdavidw
Copy link
Member

wdavidw commented Sep 12, 2022

Nope, I don't have much time lately. Moreover, this is a TS compilation error, and I am no expert in that matter.

@jhrdina
Copy link

jhrdina commented Sep 17, 2023

@aryobenholzner Parser extends stream.Transform from Node, the on method comes from stream.Transform.

By default, these Node types are missing.

To add the missing Node types, simply install the @types/node package.

npm install -D @types/node

It might make sense to add @types/node into the dev dependencies of this library but I don't know whether it is a best practice.

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

No branches or pull requests

3 participants