Skip to content

undefined is not an object (evaluating 'regeneratorRuntime.mark') #14838

Closed
@Amurmurmur

Description

@Amurmurmur

Is this a bug report?

Yes
(write your answer here)

Have you read the Bugs section of the Contributing to React Native Guide?

(Write your answer here.)

Environment

  1. react-native -v: 0.45.1
  2. node -v: 8.1.3
  3. npm -v: 5.0.4
  4. yarn --version (if you use Yarn): 0.27.5

Then, specify:

  1. Target Platform (e.g. iOS, Android): Android
  2. Development Operating System (e.g. macOS Sierra, Windows 10): macOS Sierra 10.12.5
  3. Build tools (Xcode or Android Studio version, iOS or Android SDK version, if relevant): Android SDK 25, Android Build Tools 25.0.2

Steps to Reproduce

(Write your steps here:)

  1. react-native init AwesomeProject
  2. react-native run-android

Expected Behavior

Should work as it did with RN v0.44.0 or RN 0.45.0
(Write what you thought would happen.)

Actual Behavior

undefined is not an object (evaluating 'regeneratorRuntime.mark')
<unknown>
    
loadModuleImplementation
    require.js:174:12
guardedLoadModule
    require.js:126:36
_require
    require.js:110:24
<unknown>
    index.js:2
loadModuleImplementation
    require.js:174:12
guardedLoadModule
    require.js:126:36
_require
    require.js:110:24
<unknown>
    configureStore.js:19
loadModuleImplementation
    require.js:174:12
guardedLoadModule
    require.js:126:36
_require
    require.js:110:24
<unknown>
    index.js:32
loadModuleImplementation
    require.js:174:12
guardedLoadModule
    require.js:126:36
_require
    require.js:110:24
<unknown>
    index.android.js:10
loadModuleImplementation
    require.js:174:12
guardedLoadModule
    require.js:119:45
_require
    require.js:110:24
global code
   

screen shot 2017-07-05 at 22 42 33

(Write what happened. Add screenshots!)

Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

Activity

messense

messense commented on Jul 6, 2017

@messense

+1

messense

messense commented on Jul 6, 2017

@messense

I am getting this on 0.46

Amurmurmur

Amurmurmur commented on Jul 6, 2017

@Amurmurmur
Author

Alright seems like I've managed to fix this on RN 0.45.1
Just clean everything:

watchman watch-del-all
rm -rf $TMPDIR/react-*
rm -rf yarn.lock
rm -rf ./node_modules
yarn install

Worked for me, also unlinking and linking might help.

ernoaapa

ernoaapa commented on Jul 6, 2017

@ernoaapa

Face same problem when creating new project with Ignite.

  • react-native -V 0.45.1
  • node -v v7.10.0
  • npm -v 4.2.0
  • yarn --version 0.27.5
  • react-native run-ios

@Amurmurmur suggestion didn't help.

ernoaapa

ernoaapa commented on Jul 6, 2017

@ernoaapa

Found the problem what I had (with new project generated with Ignite).

The error were pointing in my project to line import rootSaga from '../Sagas/' which contain export like this:

export default function * root () {
  yield [
    // ... snip ....
  ]
}

After changing it to this started to work:


const root = function * root () {
  yield [
    // .... snip ....
  ]
}
export default root

I'm not yet familiar with the ES6 generator functions and require support for them, but at least now I can continue. And have to say that the error were pointing to the place where the invalid export were. I hope this helps someone.

GantMan

GantMan commented on Jul 6, 2017

@GantMan
Contributor
grabbou

grabbou commented on Jul 6, 2017

@grabbou
Contributor

Wasn't this fixed here? e7c1cf5

GantMan

GantMan commented on Jul 6, 2017

@GantMan
Contributor

So this won't roll out till 0.47?

grabbou

grabbou commented on Jul 6, 2017

@grabbou
Contributor
Amurmurmur

Amurmurmur commented on Jul 6, 2017

@Amurmurmur
Author

Tried to fix with the suggested Saga solution, its surely something to do with saga because when I comment out saga implementation in my configureStore, the error is gone however trying suggested solution doesnt work for me. :/

Amurmurmur

Amurmurmur commented on Jul 6, 2017

@Amurmurmur
Author

@grabbou @GantMan @ernoaapa
Alright guys, figured out the problem
downgraded babel-preset-react-native form 2.1.0 to 2.0.0 all works fine on Android/iOS
Though once upgraded to 0.46 the error comes back.
As for RN 0.47-rc.0, most packages I have linked, wont work due to some changes to the api of the react-native I guess because they will throw errors such as:

:react-native-blur:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/Users/amurmurmur/exampleapp/node_modules/react-native-blur/android/src/main/java/com/cmcewen/blurview/BlurViewPackage.java:23: error: method does not override or implement a method from a supertype
    @Override
    ^
Note: /Users/amurmurmur/exampleapp/node_modules/react-native-blur/android/src/main/java/com/cmcewen/blurview/BlurringView.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
:react-native-blur:compileReleaseJavaWithJavac FAILED
kcalmes

kcalmes commented on Jul 7, 2017

@kcalmes

@Amurmurmur I am still seeing the issue on 0.45.1 even after downgrading babel. I wonder how much node and npm versions might be affecting which fixes work and which ones don't.
node: v8.1.0
npm: 5.1.0
OS: macOS Sierra 10.12.5

Amurmurmur

Amurmurmur commented on Jul 7, 2017

@Amurmurmur
Author

@kcalmes Make sure you reset react-native packager after you've downgraded babel with:

npm start -- --reset-cache

100 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @gibo@shenjunru@brentvatne@matt-oakes@ide

        Issue actions

          undefined is not an object (evaluating 'regeneratorRuntime.mark') · Issue #14838 · facebook/react-native