I'm setting-up a continuous integration environment for some react-based mobile app and after a react upgrade, I got this error:
Uncaught Error: Invariant Violation: EventPluginRegistry: Cannot inject two different event plugins using the same name, `TapEventPlugin`.
Do you have any idea why this happened and how to solve it ?
This happens with React v0.14.7 and react-tap-event-plugin v0.2.2.
To fix this issue require only one time react-tap-event-plugin lib in your app, for example in your main js file:
var tapEventPlugin = require("react-tap-event-plugin")();
The other answer responds to your question directly, but, an indirect answer is that this error is caused because your CI is currently updating your dependencies, and it most certainly should not be.
You can solve this by locking your dependencies and only updating when you're either ready or need to.
Related
I have built a small practice project using React and Vite, and everything worked well in the development environment.
However, when I built it and attempted to preview it, I encountered the following error:
"Uncaught ReferenceError: require is not defined."
The issue is that I do not use the 'require' function in my code, I only use imports. Is this related to the npm packages that I have installed?
If so, how can I find the correct package to fix it or are there any other solutions?
I attempted to install a plugin called 'vite-require' but it did not work (maybe I did something incorrectly).
I am writing here in hopes of finding a solution to this issue.
Thank you for any answers in advance.
I am working on a full-stack app. My front-end, built on React was working fine. I installed cors for my back-end and it suddenly started giving me Invalid hook call error in my react app.
I tried uninstalling the dependency and also reverting to 2 old commits but it didn't work. I'm thinking it might be because of a peer dependency causing multiple versions of React. I tried npm ls react and npm ls react-dom but I have only one version for each i.e. 17.0.2.
The error message is also not helpful as I cannot understand where to start digging from. Attaching it below.
Here's the code repo (I couldn't figure out which part of code to share). The React code is inside the client directory. If someone can pinpoint me where to look or help me with the issue I'll be obliged. Thanks!
Error message
I am currently developing 2 Vue apps. Both of them run from npm.
App1 wasn't created by me. I got involved in it when it was already a stable production app (so I may have missed some configuration).
App2 was created by me and I'm the only developer.
In both apps I use vue-router to change views and I found 2 different situations:
When I run both apps locally (with npm): App2 throws errors (to
console) from vue-router when I try to navigate to the same view
(Navigation Duplicated), but App1 doesn't.
When I run both apps on server (online): Both apps throw this error to
console.
I know what the error is about, but what I don't know is why App1 doesn't throw it. I already searched App1 for any error catching methods, which maybe were implemented to not throw the errors, but I didn't find any.
Because of difference between local/server functionality, I don't think it's a vue-router issue, but rather Vue itself, because there's also second issue with App1.
In App1 I use vee-validate and it throws errors regarding not available validation items (Validating a non-existent field: "result". Use "attach()" first.). The error can only be seen online (server), but not locally (npm) - for me it confirms it (as I didn't find any error catching methods regarding vee-validate).
Is there any setting in Vue, which could cause the errors not to be thrown to console?
Edit:
Reproduction of error: To reproduce and throw vue-router NavigationDuplicated error you should implement component in your Vue app and click it twice. The first click should navigate you to view, the second click should throw error in console.
I tried to run a new React Native (Android) project I got from somebody. When I run yarn install, the following error happens. How can I fix this ? I am new to react native.
patch-package: Applying patches...
**ERROR** Failed to apply patch for package react-native-confirmation-code-input
This error was caused because Git cannot apply the following patch file:
patches/react-native-confirmation-code-input+1.0.4.patch
This is usually caused by inconsistent whitespace in the patch file.
For anyone having this problem, this isn't a React-Native problem per se, it's because the library patch-package is trying to apply a patch for "react-native-confirmation-code-input" and fails.
This is mostly caused when the patch is created in Linux/MacOS and then used in Windows, because of EoL differences.
my project is contains two dependency that need different version of React dependency,
when i set the react version ^15.0.0, the first dependency (input-moment) showing warning message at the browser console like the message below
Warning: Unknown props i, w on tag. Remove these props from the element.
but when i set the react version ^0.14.0, the second dependency (recharts) showing this warning message on the console
Warning: You are manually calling a React.PropTypes validation function for the allowDecimals prop on XAxis. This is deprecated and will not work in production with the next major version. You may be seeing this warning due to a third-party PropTypes library.
please help, how to solve this?
-> npm input-moment
-> npm recharts
Interestingly, both list peer dependencies of React 14 or 15.
https://github.com/recharts/recharts/blob/master/package.json
https://github.com/wangzuo/input-moment/blob/master/package.json
So both libraries contain bugs and an issue should be raised with them on github. If a package lists v15 as a peer, and doesn't work with said version I consider that a bug.
Just did a search on their issue tracker:
https://github.com/wangzuo/input-moment/issues/36