Open btakita opened 1 year ago
Would be great to add at least one example of using import
/require
. Currently there's no such example anywhere.
Hello,
I am pretty new with javascript
I am working with a rails 7 app, and trying to make this work,
In my script i have :
import Papa from "https://unpkg.com/papaparse@latest/papaparse.min.js";
But in my browser console i have the following error :
SyntaxError: The requested module 'papaparse' does not provide an export named 'default'
Is this the same issue ? 🤔
Any idea of how to make this work ? 🤔
Is there an update on the progress of this? Using papaparse in a project with "type":"module"
(via tsx
) gives me this error:
import { parse, ParseResult } from 'papaparse';
^
SyntaxError: The requested module 'papaparse' does not provide an export named 'parse'
Oddly enough, this works:
import papaparse from 'papaparse';
const { parse } = papaparse;
In a node.js environment, Papa parse only supports commonjs. I will create a PR to add ESM support.