Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning when starting with react-native #325

Closed
maximilize opened this issue May 11, 2020 · 11 comments · Fixed by #326
Closed

Warning when starting with react-native #325

maximilize opened this issue May 11, 2020 · 11 comments · Fixed by #326

Comments

@maximilize
Copy link

I get this warning when starting the metro server:

warn Package i18next-locize-backend has been ignored because it contains invalid configuration. Reason: Package exports for 'node_modules/i18next-locize-backend' do not define a './package.json' subpath

However, everything is still working as expected.

@adrai
Copy link
Contributor

adrai commented May 11, 2020

Interesting... never seen this... and also not familiar with react-native.
Same here: facebook/react-native#28710

Any help is welcome 🙏

@demchenkoalex
Copy link
Contributor

Hi @adrai saw the similar issue in the UUID repo uuidjs/uuid#444 and there is a PR by the library maintainers that has some discussion in it and supposedly fixes the warning uuidjs/uuid#449 maybe this will help you, I believe this appears only in the repositories which support both Node and React Native environments for example.

@adrai
Copy link
Contributor

adrai commented May 13, 2020

Thanks for the info.
As I’m not familiar with react-native, can someone test if adding “./package.json” to the exports in the package.json file would help here?

@demchenkoalex
Copy link
Contributor

Hi @adrai checked in our project, warning is no longer there. Opened a PR. Please double check if everything is ok in Node, I only checked React Native :)

@adrai
Copy link
Contributor

adrai commented May 13, 2020

Thank you very much.
Can you also check if this works in react-native, when requiring “i18next-locize-backend/cjs” ?

@adrai
Copy link
Contributor

adrai commented May 13, 2020

fyi: seems this makes no difference in Node

@adrai
Copy link
Contributor

adrai commented May 13, 2020

Thank you very much.
Can you also check if this works in react-native, when requiring “i18next-locize-backend/cjs” ?

@demchenkoalex as soon as you confirm I will merge the PR

@demchenkoalex
Copy link
Contributor

demchenkoalex commented May 13, 2020

Works with import Locize from 'i18next-locize-backend/cjs'

I did:

  • installed Locize from my commit
  • in node_modules/i18next-locize-backend did yarn to install dev dependencies
  • yarn compile to create cjs folder

@adrai
Copy link
Contributor

adrai commented May 13, 2020

released in v4.0.8

thank you very much for your help

@ctavan
Copy link

ctavan commented May 13, 2020

I think it might make more sense to actually fix this in react-native instead of adding this workaround to every single module on npm. If you agree, feel free to give your 👍 for react-native-community/cli#1168

@demchenkoalex
Copy link
Contributor

Not every single one (only the ones with node env supported) but yes, makes sense :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants