expo: Updating to SDK 20 => can't read property "mark" of undefined

Hi,

After upgrading to SDK 20 on Android I get these errors and application stays on splash screen:

ExceptionsManager.js:65 Cannot read property 'mark' of undefined
ExceptionsManager.js:65 Module AppRegistry is not a registered callable module (calling runApplication)

My application runs fine in SDK19.

Any idea?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 5
  • Comments: 17 (12 by maintainers)

Most upvoted comments

Are you using sagas?

If so, you should change

export function* gen() { }

to

const gen = function* () { };
export const genSaga = gen;

At least for now. You can track this issue here https://github.com/facebook/react-native/issues/14838

@dikaiosune @ide any idea? or will you delete my comment too 😄 ?

The workaround in this thread worked for me. Gonna copy my comment from here in case it’s helpful to anyone:

This resolved it for me: https://github.com/expo/expo/issues/519. To be clear, if you have a generator function like function* namedGenerator() {}, you can’t use it directly as namedGenerator, you need to set it as some variable/constant first… e.g.:

const namedGeneratorFn = function* namedGenerator() {};

// This will NOT work!
// export default namedGenerator;

// This will work
export default namedGeneratorFn;

React Native (upstream) updated its Babel preset to babel-preset-react-native@2 so we updated babel-preset-expo@3 to use it. Therefore the breaking changes in RN’s preset apply to Expo’s preset too.

Is this issue not fixed yet?

I had the same issue and setting generator to const variable solved the issue for me. But that should not be the permanent fix, right?

Thanks.

You need babel-preset-react-native 2.0.1 or newer. If you have that under node_modules then you should be fine and don’t need to modify your code. You might want to clear your packager caches just to be safe though.

babel-preset-react-native v2.0.1 (which babel-preset-expo v3 pulls in) should have the fix. If you run yarn upgrade you should get it.

thanks @schettino it seems to work.

The problem is not related to exports but rather all function declarations should be assigned to variables to solve the problem.