question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ES6 module for PapaParse

See original GitHub issue

While upgrading to Angular 10, using PapaParse gives following warning message - WARNING in C:\parser.component.ts depends on papaparse. CommonJS or AMD dependencies can cause optimization bailouts.

This seems to be because PapaParse is CommonJS module dependency.

I am importing papaparse as follows - import * as csvParser from 'papaparse';

and using it as - csvParser.parse(file, {});

Can you help me with an ES6 module that I could use instead?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:17
  • Comments:7

github_iconTop GitHub Comments

7reactions
PooShamcommented, Oct 7, 2020

@pokoli That doesn’t seem very relevant at all. ES6 modules are part of modern javascript, they have nothing to do with typescript.

The import and export keywords are now native to javascript, and you can now isolate your files as modules without wrapping everything in a function that you call (like you do now). If you still want backward compatibility, you can use babel that will generate CommonJS and AMD modules for you. Your code gets cleaner and users of this library can get more aggressive optimization. win-win.

TLDR; Having typescript definitions is not enough. We want ES6 modules.

3reactions
Silic0nS0ldiercommented, Jun 9, 2021

As a first step I’ve created a PR that introduces support in (hopefully) the least backwards incompatible way. The code I’m confident with, build system support less so. Anyone up for some integration testing? PR is https://github.com/mholt/PapaParse/pull/875

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to import papaparse in javascript? - Stack Overflow
I installed papaparse using npm install papaparse in my createa folder. However, when I try to do import { Papa } from 'papaparse';...
Read more >
Papa Parse - Powerful CSV Parser for JavaScript
The powerful, in-browser CSV parser for big boys and girls. Download Demo Documentation.
Read more >
Developers - ES6 module for PapaParse - - Bountysource
While upgrading to Angular 10, using PapaParse gives following warning message - WARNING in C:\parser.component.ts depends on papaparse.
Read more >
Papa Parse: Lightning Fast CSV Parsing Experience - codeburst
babel or ES6 */ import papaparse from 'papaparse';/* node or require js */ const papaparse = require('papaparse'); ...
Read more >
How to use the papaparse.parse function in papaparse - Snyk
To help you get started, we've selected a few papaparse.parse examples, ... showErrorDialog( `The csv file you are trying to import contains no...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found