Skip to content
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

Can not start my project after updating to sdk31, can not read property one of undefined #2834

Closed
shubhamdeol opened this issue Nov 28, 2018 · 13 comments

Comments

@shubhamdeol
Copy link

shubhamdeol commented Nov 28, 2018

Updating to expo sdk 31, from sdk 30.
exact error:
PathToProject/node_modules/expo/AppEntry.js: Cannot read property '1' of undefined

image
Solution I tried*
Tried going back to sdk 30, everything works again.
Opened AppEntry File found below lines, I guess something wrong with keep awake.

import { KeepAwake, registerRootComponent } from 'expo';
import App from '../../App';

if (__DEV__) {
  KeepAwake.activate();
}

registerRootComponent(App);

if something is wrong with my babel settings, then please let me know, below are settings for bebel.

{
  "presets": ["babel-preset-expo"],
  "env": {
    "development": {
      "plugins": ["transform-react-jsx-source"]
    }
  }
}

also tried changing transform-react-jsx-source to @babel/transform-react-jsx-source

@mauriciord
Copy link
Contributor

same here @shubhamdeol
did you find a solution ?

@shubhamdeol
Copy link
Author

@mauriciord not yet, let me know if you find any

@shubhamdeol
Copy link
Author

@mauriciord finally able to fix this with : yarn add babel-plugin-module-resolver@latest
read here:
https://forums.expo.io/t/babel-preset-expo-error-after-upgrading-to-v31/15523/3

@mauriciord
Copy link
Contributor

mauriciord commented Nov 28, 2018

my app successfully started, but my assets (<Image /> and <Animated.Image />) are very slow to load @shubhamdeol

@shubhamdeol
Copy link
Author

what solution you used?
I just fixed with yarn add babel-plugin-module-resolver@latest
and had no issue with assets loading

@mauriciord
Copy link
Contributor

mauriciord commented Nov 28, 2018

@shubhamdeol
removed .babelrc, included babel.config.js:

module.exports = function (api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: [
      [
        'module-resolver',
        {
          root: ['.'],
          alias: {
            components: './src/components',
            constants: './src/constants',
            features: './src/features',
            navigation: './src/navigation',
            screens: './src/screens',
            services: './src/services',
            shared: './src/shared',
            state: './src/state',
            utils: './src/utils',
            assets: './assets',
          },
        },
      ],
    ],
  };
};

added npm i --save-dev babel-plugin-module-resolver@latest

but only the <Animated.Image /> inside <Animated.View is slow.
THIS IS HAPPENING ONLY ON iOS

@Beissner
Copy link

Was this resolved? I'm running into the same error after updating to sdk 31.

@mauriciord
Copy link
Contributor

@Beissner No, it's a problem with metro

@mauriciord
Copy link
Contributor

@Beissner
Copy link

Sorry. I meant the error " Cannot read property '1' of undefined". I think it's related to Babel, I've tried just about everything. Any suggestions?

@brentvatne
Copy link
Member

@Beissner - does this happen if you remove everything from App.js except a simple component that just renders a single View? if it doesn't error in that case then I'd start from there and slowly add back parts of your app until you can find the specific area that's causing the error, and let us know about it here

@rdibona
Copy link

rdibona commented Feb 12, 2019

@Beissner

Sorry. I meant the error " Cannot read property '1' of undefined". I think it's related to Babel, I've tried just about everything. Any suggestions?

I updated to sdk32 and did the step above with deleting .babelrc and running
npm i --save-dev babel-plugin-module-resolver@latest

I am now back in business.

@shubhamdeol
Copy link
Author

Was this resolved? I'm running into the same error after updating to sdk 31.

did you tired this #2834 (comment)

@lock lock bot added the outdated label Aug 12, 2019
@lock lock bot locked and limited conversation to collaborators Aug 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants