didyoumean2
didyoumean2 copied to clipboard
Can't import the named export 'distance'
I use your library in a React project. It runs just fine, and I quite fond of it.
Hovever I get an error message when I want to make a production build.
./node_modules/didyoumean2/dist/index.mjs Can't import the named export 'distance' from non EcmaScript module (only default export is available)
I made a search and it seems that the react cli tools create-react-app could not handle a certain export type. I tried a suggested solution to add react-app-rewired and make a configuration change, but it is not working for me.
Now I stranded here.
Can you try the cjs build?
./node_modules/didyoumean2/dist/index.cjs
How can I use the cjs build? I import this way:
import didYouMean, { ReturnTypeEnums } from "didyoumean2";
I tried with import didYouMean, { ReturnTypeEnums } from "didyoumean2/dist/index.cjs";
The build failed with: Attempted import error: 'ReturnTypeEnums' is not exported from 'didyoumean2/dist/index.cjs'' My only workaround is that I use version 3.1.0
Any better idea?