Open jesster2k10 opened 4 years ago
@jesster2k10 I'm seeing this error as well, did you manage to fix this?
@jesster2k10 I'm seeing this error as well, did you manage to fix this?
The only solution i’ve found was to not upgrade unfortunately. I don’t know what’s causing the issue, and it seems to only exist in that code base and i haven’t been able to get any support online.
I managed to get this working in the end. It was caused by one of our internal libraries we were using - I didn't have a chance to work out what part was causing the issue, but we didn't actually need it, so I ended up replacing it.
The way you can find the error is by starting at your root file such as App.ts
or index.ts
and comment out the main app and replace with a stub such as <Text>Hello</Text>
, then if that renders you can start re-enabling stuff until it crashes again, which will help you find the cause.
Hey, glad to hear you got it working. I’ve over 50k SLOC in my project, about 32 screens and dozens of dependencies. It would take me forever to do that, so I think I’ll continue to wait it out until most of my packages require updating and hopefully the issue might be resolved by then. I tried to update as soon as the update came out, which my have its shortfalls.
On 20 May 2020, at 21:07, Alex Brazier notifications@github.com wrote:
I managed to get this working in the end. It was caused by one of our internal libraries we were using - I didn't have a chance to work out what part was causing the issue, but we didn't actually need it, so I ended up replacing it.
The way you can find the error is by starting at your root file such as App.ts or index.ts and comment out the main app and replace with a stub such as
Hello , then if that renders you can start re-enabling stuff until it crashes again, which will help you find the cause.— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/react-native-community/upgrade-support/issues/47#issuecomment-631697791, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRHYDTXGJ7MDDYNDC2FJ3TRSQZ6ZANCNFSM4MD7VFBA.
have you finish it ? @jesster2k10 i have same error
@jesster2k10 I have solve this problem ... it looks like something libraries upgrade Cause
I was experiencing this problem. In my case, I had run yarn
in the root folder of my native module project (unnecessarily). For some reason, the presence of the node_modules
folder at the root prevented the example
app from running properly. If I removed the root node_modules
folder, the app ran correctly.
have the same issue. So far not been able to solve it. No idea what is causing this error. My app was working perfectly one day. Went to sleep and did not change ANYTHING, re-ran my app and I got this error. Why am I always spending more time debugging tooling with react-native than ACTUALLY programming? This is very frustrating...
Very frustrating for me also this one
I never found the solution, I ended up re-writing the project before deciding to ditch RN and just use native code. Once the app goes live, I won't be able to deal with issues like this that prevent me from working and inherently have no solutions.
On Wed, Jul 8, 2020 at 8:54 AM tomheathershub notifications@github.com wrote:
Very frustrating for me also this one
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/react-native-community/upgrade-support/issues/47#issuecomment-655354107, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRHYDQAXDD2QTZGQYG2O4DR2QQ4BANCNFSM4MD7VFBA .
jules15's solution worked for me to. Make sure you do NOT have any node_modules in any of your dependencies. rm -rf
on them if you have some
@jules15 i did not run yarn
inside node_modules
libraries yet some libraries have node_modules
,did you get a better solution ?
Add blacklist tometro.config.js
like this
const blacklist = require('metro-config/src/defaults/blacklist');
module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
resolver: {
blacklistRE: blacklist([
/node_modules\/.*\/node_modules\/react-native\/.*/,
])
},
};
Hi! I faced with this problem too.
I tried the command for clearing rn cache and the problem was gone.
Used it in macos.
watchman watch-del-all ; cd $TMPDIR && rm -rf *metro* ; cd PROJECT_PATH && rm -rf node_modules && npm i && npx pod-install && npx react-native start -- --reset-cache
don't forget to replace PROJECT_PATH
Add blacklist to
metro.config.js
like thisconst blacklist = require('metro-config/src/defaults/blacklist'); module.exports = { transformer: { getTransformOptions: async () => ({ transform: { experimentalImportSupport: false, inlineRequires: false, }, }), }, resolver: { blacklistRE: blacklist([ /node_modules\/.*\/node_modules\/react-native\/.*/, ]) }, };
This worked for me.
Add blacklist to
metro.config.js
like thisconst blacklist = require('metro-config/src/defaults/blacklist'); module.exports = { transformer: { getTransformOptions: async () => ({ transform: { experimentalImportSupport: false, inlineRequires: false, }, }), }, resolver: { blacklistRE: blacklist([ /node_modules\/.*\/node_modules\/react-native\/.*/, ]) }, };
For version 0.64.1
const exclusionList = require('metro-config/src/defaults/exclusionList');
module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
resolver: {
blockList: exclusionList([
/node_modules\/.*\/node_modules\/react-native\/.*/,
]),
},
};
By the way, i think it maybe bettter to declare react-native as peerDependency and devDependency in third party library rather than dependency. In this way, we don't need to install react-native in third party library's node_modules, and can avoid above problem.
Environment
Upgrading version
Upgrading from 0.61.5 -> 0.62.1
Description
I followed all of the guides regarding the upgrade and got this issue. I tried to solve it by creating a new typescript project on version 0.62.1 and copying all my code over, however, the error still remains.
In the JS console there are several other similar issues shown like so:
It's worth nothing that hot refresh does not work either for some reason. This issue did not exist before upgrading to 0.62.1. I downgraded to 0.62.0 also but to now avail
Reproducible demo
App.tsx
Podfile
Screenshots
What I've tried
rm -rf node_moduels && yarn
react-native start --reset-cache