Skip to content

Cannot upgrade from 0.63.4 to 0.64, 0.65 or 0.66 #178

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

Closed
tijs opened this issue Sep 30, 2021 · 1 comment
Closed

Cannot upgrade from 0.63.4 to 0.64, 0.65 or 0.66 #178

tijs opened this issue Sep 30, 2021 · 1 comment

Comments

@tijs
Copy link

tijs commented Sep 30, 2021

Environment

System:
OS: macOS 11.6
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 3.11 GB / 32.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.4.0 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.21.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0
Android SDK: Not Found
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7678000
Xcode: 13.0/13A233 - /usr/bin/xcodebuild
Languages:
Java: 11.0.12 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.65.1 => 0.65.1
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Things I’ve done to figure out my issue

  • I've use upgrade helper to update all package versions to the exact same as 0.64 up to 0.66
  • I have tried the latest babel versions as well
  • I have tried to use the 0.63 babel versions with later versions of RN
  • I have tried several different metro & babel configurations
  • I have tried setting the resolution fields for metro dependencies the same in my project as in 0.63

Upgrading version

I would like to upgrade to the latest stable from 0.63.4, tried 0.64, 0.65 and the 0.66 rc versions

Description

As soon as I bump the react-native version beyond 0.63.4, even if I keep my babel versions the same, metro stops being able to create a valid bundle.

If I run:

npx react-native bundle --platform ios --entry-file index.js --bundle-output ./bundles/index.ios.bundle --assets-dest ./bundles/ --dev true

I will get the following error:

error lib/src/service/LocationService.ts: function (path) {
          return fn.call(state, path, state);
        } could not be cloned.
Error: function (path) {
          return fn.call(state, path, state);
        } could not be cloned.
    at Object.serialize (node:v8:260:7)
    at _default (/Users/tijs/projects/persgroep/popular-platform-app/node_modules/@babel/core/lib/transformation/util/clone-deep.js:22:34)
    at normalizeFile (/Users/tijs/projects/persgroep/popular-platform-app/node_modules/@babel/core/lib/transformation/normalize-file.js:84:36)
    at normalizeFile.next (<anonymous>)
    at run (/Users/tijs/projects/persgroep/popular-platform-app/node_modules/@babel/core/lib/transformation/index.js:29:50)
    at run.next (<anonymous>)
    at /Users/tijs/projects/persgroep/popular-platform-app/node_modules/@babel/core/lib/transform-ast.js:26:41
    at Generator.next (<anonymous>)
    at evaluateSync (/Users/tijs/projects/persgroep/popular-platform-app/node_modules/gensync/index.js:251:28)

If I remove the import of that file it just fails on something else:

error src/nieuws-wereld/src/common/linking/Navigations.ts: #<WeakSet> could not be cloned.
Error: #<WeakSet> could not be cloned.
    at Object.serialize (node:v8:260:7)
    at _default (/Users/tijs/projects/persgroep/popular-platform-app/node_modules/@babel/core/lib/transformation/util/clone-deep.js:22:34)
    at normalizeFile (/Users/tijs/projects/persgroep/popular-platform-app/node_modules/@babel/core/lib/transformation/normalize-file.js:84:36)
    at normalizeFile.next (<anonymous>)
    at run (/Users/tijs/projects/persgroep/popular-platform-app/node_modules/@babel/core/lib/transformation/index.js:29:50)
    at run.next (<anonymous>)
    at /Users/tijs/projects/persgroep/popular-platform-app/node_modules/@babel/core/lib/transform-ast.js:26:41
    at Generator.next (<anonymous>)
    at evaluateSync (/Users/tijs/projects/persgroep/popular-platform-app/node_modules/gensync/index.js:251:28)

So while I cannot find anything on the particular babel error it seems clear it cannot transform any (or most) files in my project.

I have fixed a lot of other upgrade issues by now (see my other issues on here) but I have not found any solutions (or similar issues on GitHub) for this one... any pointers on where I should be poking are very welcome!

@tijs
Copy link
Author

tijs commented Sep 30, 2021

Ok so it turns out that simply throwing away the yarn.lock and running yarn again somehow fixed all the babel issues. Apparently your yarn.lock can become such a mess nothing works anymore.

Hat tip to the comment here facebook/react-native#31413 (comment)

@tijs tijs closed this as completed Sep 30, 2021
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

1 participant