I have a Svelte/Js/Vite app and need to import Papaparse. It's installed as npm install papaparse
and is present in the package.json
.
When I import it as import * as Papa from "papaparse";
, methods are not visible in the IDE (i.e. parse()
) and the following error is shown:
error loading dynamically imported module. This could be due to syntax errors or importing non-existent modules. (see errors above)
When I import it as import {Papa} from "papaparse";
, methods are visible in the IDE, but there s a message
Cannot resolve symbol 'Papa'
and it anyway doesn't work in a browser with the same error.
What is the proper way to import and what is the reason for these problems.