reactjsviteramda.js

Vite: how to fix "does not provide an export named 'default" when importing Ramda


I have a project that is running on vite and Ramda but I have a "does not provide an export named 'default'" error when using Ramda.


Solution

  • I faced same problem with Vite + React project. As per Ramda documentation: "ramda versions > 0.25 don't have a default export. So instead of import R from 'ramda', one has to use import * as R from 'ramda' or import { functionName } from 'ramda'".

    Using import * as R from 'ramda' fixed issue for me.