question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

expo start failed after SDK 45 upgrade - expo-keep-awake function could not be cloned

See original GitHub issue

Summary

expo start failed systematically after upgrading to SDK 45.

node_modules/expo-keep-awake/build/index.js: 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:333:7)
    at _default (/home/me/project/node_modules/@babel/core/lib/transformation/util/clone-deep.js:22:34)
    at normalizeFile (/home/me/project/node_modules/@babel/core/lib/transformation/normalize-file.js:84:36)
    at normalizeFile.next (<anonymous>)
    at run (/home/me/project/node_modules/@babel/core/lib/transformation/index.js:31:50)
    at run.next (<anonymous>)
    at /home/me/project/node_modules/@babel/core/lib/transform-ast.js:26:41
    at Generator.next (<anonymous>)
    at evaluateSync (/home/me/project/node_modules/gensync/index.js:251:28)

Note that I do not use expo-keep-awake directly, it is not linked in my package.json

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

Android

SDK Version (managed workflow only)

45

Environment

  expo-env-info 1.0.3 environment info:
    System:
      OS: Linux 5.4 Ubuntu 20.04.4 LTS (Focal Fossa)
      Shell: 5.8 - /usr/bin/zsh
    Binaries:
      Node: 16.14.0 - /usr/bin/node
      Yarn: 1.22.18 - /usr/bin/yarn
      npm: 8.7.0 - /usr/bin/npm
    npmPackages:
      expo: ^45.0.0 => 45.0.2 
      react: 17.0.2 => 17.0.2 
      react-native: 0.68.1 => 0.68.1 
    npmGlobalPackages:
      eas-cli: 0.52.0
      expo-cli: 5.4.3
    Expo Workflow: managed

Reproducible demo

None

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9

github_iconTop GitHub Comments

4reactions
seedalricommented, May 10, 2022

It seems I have the same problem here. Updated to Expo 45 (from 37) and now I get this error.

iOS Bundling failed 113ms node_modules/expo-keep-awake/build/index.js: 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 (v8.js:249:7) at _default (/Users/user/project/node_modules/@babel/core/lib/transformation/util/clone-deep.js:22:34) at normalizeFile (/Users/user/project/node_modules/@babel/core/lib/transformation/normalize-file.js:84:36) at normalizeFile.next (<anonymous>) at run (/Users/user/project/node_modules/@babel/core/lib/transformation/index.js:31:50) at run.next (<anonymous>) at /Users/user/project/node_modules/@babel/core/lib/transform-ast.js:26:41 at Generator.next (<anonymous>) at evaluateSync (/Users/user/project/node_modules/gensync/index.js:251:28)

1reaction
randiekascommented, Jun 27, 2022

i have same issue after upgrade to sdk 45. this way is really work for me

  • delete yarn.lock
  • delete forder node_modules
  • yarn install
Read more comments on GitHub >

github_iconTop Results From Across the Web

expo-keep-awake function could not be cloned - Stack Overflow
I have same issue after upgrade to sdk 45 . This way is really work for me: Delete the file yarn.lock; Delete the...
Read more >
KeepAwake - Expo Documentation
A React hook to keep the screen awake for as long as the owner component is mounted. The optionally provided tag argument is...
Read more >
expo failed to resolve plugin for module - You.com | The AI ...
Hi, just looking for some support as I am new to using config plugins and I can't figure out why I can't install...
Read more >
Expo SDK 41 - DEV Community ‍ ‍
We will take care of switching the packages in your dependencies in package.json when you run expo upgrade , but after that you...
Read more >
Using the React.cloneElement() function to clone elements
It clones and returns a new element using its first argument as the starting point. This argument can be a React element or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found