-
Notifications
You must be signed in to change notification settings - Fork 24.6k
I have an error when make debug build. (error node_modules/react-native-keyboard-aware-scroll-view/lib/KeyboardAwareHOC.js: #<WeakSet> could not be cloned.) anyone have this error #31413
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
Comments
I have a similar issue with all kinds of modules |
I think the problem might be with @babel/core and @babel/runtime versions. I downgraded to the below versions and it worked for me; "@babel/core": "^7.12.9", |
Sadly, I am still with the same issue, and doesn't find a way out. For me, it seems the problem is when babel (react native by default is using metro-react-native-babel-preset) trying to transform file, it requires to deep clone the value, and it is using v8.deserialize(v8.serialize(value)) to do that; however, in some versions of v8, the file have been recognized as WeakSet, and therefore threw the DataCloneError. I have tried several ways, including changing the clone method as per the following code suggested by @amiller-gh Would anyone have other workarounds that may be useful? Thanks in advance! |
As @japhet247 suggested, downgrading |
Hi @jmikulka, thanks for the reply, I had tried with @japhet247's answer too, and I had even tried downgrading React Native version back to 0.63.4 with the corresponding dependencies, and still the same case, successfully compiled, but got the |
I don't think you need to downgrade React Native itself, just the |
I've tried all the mentioned versions of @babel/core and @babel/runtime with no luck. In-between builds I ran react-native-clean-project to do a full clean. I also removed as many devDependencies as I could and only have a few in addition to those in the sample app. @dennislky Did you get it working? |
@siderakis @dennislky Metro depends on newer version of babel. Older version can be forced inside package.json this way:
Forcing this version worked for me. BUT cleaning up yarn.lock made app work on newer version. (btw, I cleaned up yarn.lock before forcing older version of babel too.) I found it out by accident ... Babel is made of like million packages for some reason. So I cleaned up yarn.lock to avoid duplication of all those babel packages, so multiple minor version of all of babel packages are resolved to just the newest version which was inside file. Then. When I just out of curiosity removed "resolve" from package.json and deleted resolution to old version, newer babel version was working just fine. Currently newer version which works for me is this: @babel/core 7.15.15 |
Update. I just tried deleting yarn.lock and it worked, no need to revert to older babel at all. :) Of course I needed to reinstall packages and fix some unrelated stuff (packages I did not wanted to update) ... :D |
Still have the same issue even removing yarn.lock, downgrading babel does not seem to resolve this. Happens after upgrade 0.64.2-0.65.1 |
Did someone find a solution to this problem? I also tried to downgrade babel etc. but still no luck.
I see OP opened an issue in the repository of this Keyboard library but unfortunately no activity. @Rananjaya Are you still running into this issue if not Im curious to know what you did to solve it. |
I'm having the same issue as described in APSL/react-native-keyboard-aware-scroll-view#481, even when downgrading babel dependencies. @steffen25 Did you find a solution ? I'm encountering the issue when upgrading to RN 0.66.4. No problem with 0.63. |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
error node_modules/react-native-keyboard-aware-scroll-view/lib/KeyboardAwareHOC.js: # could not be cloned. Run CLI with --verbose flag for more details.
Error: # could not be cloned.
at Object.serialize (v8.js:202:7)
at _default (/home/rananjaya/Desktop/child_app/ch/node_modules/@babel/core/lib/transformation/util/clone-deep.js:16:30)
at normalizeFile (/home/rananjaya/Desktop/child_app/ch/node_modules/@babel/core/lib/transformation/normalize-file.js:52:36)
at normalizeFile.next ()
at run (/home/rananjaya/Desktop/child_app/ch/node_modules/@babel/core/lib/transformation/index.js:31:50)
at run.next ()
at /home/rananjaya/Desktop/child_app/ch/node_modules/@babel/core/lib/transform-ast.js:20:41
at Generator.next ()
at evaluateSync (/home/rananjaya/Desktop/child_app/ch/node_modules/gensync/index.js:251:28)
The text was updated successfully, but these errors were encountered: