yaaliuzhipeng / react-native-mlkit-translate-text

🧑‍🏫 machine learning translator for react native . based on Google MLKit.
15 stars 2 forks source link

Error: undefined Unable to resolve module ./MLKitTranslator #1

Closed Youssouf-Ouedraogo closed 11 months ago

Youssouf-Ouedraogo commented 1 year ago

I ran both npm i react-native-mlkit-translate-text npm i --save react-native-mlkit-entity-extraction However when I try import MLKitTranslator from './MLKitTranslator'; I keep getting the error below `None of these files exist:

yaaliuzhipeng commented 1 year ago

I ran both npm i react-native-mlkit-translate-text npm i --save react-native-mlkit-entity-extraction However when I try import MLKitTranslator from './MLKitTranslator'; I keep getting the error below `None of these files exist:

  • components/MLKitTranslator(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
  • components/MLKitTranslator/index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`

Emmmm 、you are supposed to import from react-native-mlkit-entity-extraction instead of './MLkitTranslator' , that's the usage of library internal code

Youssouf-Ouedraogo commented 1 year ago

Yes I tried that as well and in that case this is the issue ` error: Error: Unable to resolve module ./MLKitEntityExtraction from /project_path/node_modules/react-native-mlkit-entity-extraction/index.js:

None of these files exist:

yaaliuzhipeng commented 1 year ago

Yes I tried that as well and in that case this is the issue ` error: Error: Unable to resolve module ./MLKitEntityExtraction from /project_path/node_modules/react-native-mlkit-entity-extraction/index.js:

None of these files exist:

  • node_modules/react-native-mlkit-entity-extraction/MLKitEntityExtraction(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
  • node_modules/react-native-mlkit-entity-extraction/MLKitEntityExtraction/index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx) 1 | // main index.js 2 |

3 | export { default as MLKitEntityExtraction } from './MLKitEntityExtraction'; | ^ 4 | export * from './MLKitEntityExtraction'; 5 |`

https://github.com/yaaliuzhipeng/react-native-mlkit-translate-text/commit/ac9b1234bad4689d056c6c0bed8e1bbb58e284ae this should fix it , now you can reinstall it from npm , the latest version => 1.0.1

Youssouf-Ouedraogo commented 1 year ago

Thanks but I updated to react-native-mlkit-translate-text 1.0.1 but the issue still persist

Youssouf-Ouedraogo commented 1 year ago

@yaaliuzhipeng Any updates on this issue?

yaaliuzhipeng commented 1 year ago

@yaaliuzhipeng Any updates on this issue?

new release 1.0.2 should fix it . you can try reinstall it and clear cache with command below I've tested it on my project within android side

> yarn remove react-native-mlkit-translate-text && yarn add react-native-mlkit-translate-text && yarn start --reset-cache 
> yarn android

or use npm version depends on your project
Youssouf-Ouedraogo commented 1 year ago

I am not sure what I am doing wrong but I am still seeing the same error. Is there any chance you would be open to sync up to talk about it?

yaaliuzhipeng commented 1 year ago

I am not sure what I am doing wrong but I am still seeing the same error. Is there any chance you would be open to sync up to talk about it?

perhaps you can start a new project to test it . if the error reproduced on the new project , just give me the access to the project code, so I can find out the reason.

xcanchal commented 11 months ago

This is not working, there is no file to import from inside the published package files (see my other issue)

yaaliuzhipeng commented 11 months ago

new release should've fixed this