Package has been ignored because it contains invalid configuration
See original GitHub issueDescribe the bug I’m seeing this error a lot recently across my project. I can’t say for sure when it occurred but seems to have been with some recent package updates.
Error is below
warn Package @fortawesome/pro-light-svg-icons has been ignored because it contains invalid configuration. Reason: Cannot find module '/Users/runner/work/1/s/node_modules/@fortawesome/pro-light-svg-icons/package.json.js'
warn Package @fortawesome/pro-regular-svg-icons has been ignored because it contains invalid configuration. Reason: Cannot find module '/Users/runner/work/1/s/node_modules/@fortawesome/pro-regular-svg-icons/package.json.js'
warn Package @fortawesome/pro-solid-svg-icons has been ignored because it contains invalid configuration. Reason: Cannot find module '/Users/runner/work/1/s/node_modules/@fortawesome/pro-solid-svg-icons/package.json.js'
It seems to be hanging a lot of build commands and gets thrown during a lot of react native and yarn commands.
Reproducible test case
react-native run-android
Expected behavior No warning should be thrown
Desktop (please complete the following information):
- “react-native”: “0.66.3”
- “@fortawesome/fontawesome-svg-core”: “6.1.1”
- “@fortawesome/pro-light-svg-icons”: “6.1.1”
- “@fortawesome/pro-regular-svg-icons”: “6.1.1”
- “@fortawesome/pro-solid-svg-icons”: “6.1.1”
- “@fortawesome/react-native-fontawesome”: “0.2.7”
Originally posted on main FontAwesome repo
Seems like its looking for package.json.js
paths when it should just be package.json
…?
Issue Analytics
- State:
- Created a year ago
- Reactions:5
- Comments:8 (4 by maintainers)
Top Results From Across the Web
warn Package undefined has been ignored because it ...
Open the package.json file and see if the bad package you uninstalled is still present. · If the bad package is still there,...
Read more >Package react-native-webview has been ignored because it ...
Bug description: I am trying to use react-native-webview and following step. But it doesn't work. yarn add react-native-webview cd ios ...
Read more >Package has been Ignored because it contains Invalid ...
This react native warning will finally leads to build error while trying to run your application. So, how to fix this particular error?...
Read more >warn Package has been ignored because it contains invalid ...
warn Package has been ignored because it contains invalid configuration. 396 views 1 year ago. MahsaTech. MahsaTech. 59 subscribers.
Read more >warn package react-native-vector-icons contains invalid ...
warn Package react-native-vector-icons has been ignored because it contains invalid configuration. Reason: "dependency.assets" is not allowed error Unrecognized ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Understood, thank you for the explanation!
I’m not the biggest fan of having local packages laying around and having to re-create the local package every time I want to use a new icon so I’ll probably just bite the faBullet. Hold the faPhone - that icon doesn’t exist? Oh well… Thanks again, I appreciate your time!
Yeah sorry about forcing the change over. The problem is that react-native doesn’t support tree-shaking. And your instinct is correct, it’s just the sheer number of icons. We added a bunch in 6 and it’s a blessing and a curse.
I will say just as an alternative you could use our Desktop Subsetter and create a subset of the icons that you use. One of the things that you will get from the subset (a .zip file) is a directory of JS packages. These are formatted exactly like our full packages. You could install these and it would speed things up tremendously.