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

Getting warning: "Package is-ip has been ignored" #12

Closed
jkoutavas opened this issue May 23, 2022 · 5 comments
Closed

Getting warning: "Package is-ip has been ignored" #12

jkoutavas opened this issue May 23, 2022 · 5 comments

Comments

@jkoutavas
Copy link

jkoutavas commented May 23, 2022

I'm getting this warning when building my React Native app:

warn Package is-ip has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /Users/jay/app/node_modules/is-ip/package.json

I'm using is-ip@^4.0.0

@sindresorhus
Copy link
Owner

That warning is invalid and the problem is React Native, not this package.

I recommend you open an issue on https://github.com/facebook/react-native/issues instead.

@sindresorhus sindresorhus closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2022
@jkoutavas jkoutavas changed the title warn Package is-ip has been ignored Getting warning: "Package is-ip has been ignored" May 23, 2022
@jkoutavas
Copy link
Author

That warning is invalid and the problem is React Native, not this package.

@sindresorhus can you explain why it's invalid? (It'll help me understand how to file a proper issue.) Thank you.

@sindresorhus
Copy link
Owner

Not exporting ./package.json is not invalid configuration, it's actually common practice not to export it. React Native should not waste the time of their users and also package maintainers with this kinds of false warnings.

@jkoutavas
Copy link
Author

jkoutavas commented May 24, 2022

Not exporting ./package.json is not invalid configuration, it's actually common practice not to export it. React Native should not waste the time of their users and also package maintainers with this kinds of false warnings.

Well, after using React Native for over 2-1/2 years, and dozens of NPM packages with it, this is the first one that gave this warning. Is it difficult to make this change to your package?

@JimTeva
Copy link

JimTeva commented Jan 21, 2023

@jkoutavas it looks like it is react-native that should update its code (react-native-community/cli#1168)

In the meantime I added "./package.json": "./package.json" in the exports, it removed the warning but unfortunately the lib does not seems to work well with react-native v0.65.1 (only tested "isIP").

Finally I asked chatGPT and it gave me that lol:

export function isIP(str: string) {
  var pattern4 =
    /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
  var pattern6 =
    /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
  return pattern4.test(str) || pattern6.test(str);
}

Works pretty well...

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

No branches or pull requests

3 participants