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.

React Native 0.46.1 does not support import/export generator functions

See original GitHub issue

Is this a bug report?

yes

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

yes

Environment

  1. react-native -v: 0.46.1
  2. node -v: v7.10.0
  3. npm -v: 4.2.0
  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): Ubuntu Linux 17.04
  3. Build tools (Xcode or Android Studio version, iOS or Android SDK version, if relevant):

Steps to Reproduce

(Write your steps here:)

  1. Create empty react-native project

  2. Add test.js in project root with generator function export: export function* doSomething() {console.log(‘test’);} export default {test: doSomething};

  3. Change index.android.js to: import React from ‘react’; import {AppRegistry, Text} from ‘react-native’; import {doSomething} from “./test”; //neither this // import doSomething from “./test”; //nor this doen’t work

class GFTest extends React.Component { render(){return <Text>hi!</Text>} } AppRegistry.registerComponent(‘gf_test’, () => GFTest);

Expected Behavior

Expected to see screen with ‘hi!’ string on it

Actual Behavior

See error screen: E/ReactNativeJS(13905): undefined is not an object (evaluating ‘regeneratorRuntime.mark’) ExceptionsManager.js:63 Cannot read property ‘mark’ of undefined handleException @ ExceptionsManager.js:63 handleError @ InitializeCore.js:125 reportFatalError @ error-guard.js:44 guardedLoadModule @ require.js:121 _require @ require.js:110 (anonymous) @ index.android.bundle…&minify=false:52122 executeApplicationScript @ debuggerWorker.js:40 (anonymous) @ debuggerWorker.js:65

E/ReactNativeJS(13905): undefined is not a function (evaluating ‘this._lazyCallableModulesname’) ExceptionsManager.js:63 this._lazyCallableModules[name] is not a function handleException @ ExceptionsManager.js:63 handleError @ InitializeCore.js:125 reportFatalError @ error-guard.js:44 __guard @ MessageQueue.js:230 callFunctionReturnFlushedQueue @ MessageQueue.js:100 (anonymous) @ debuggerWorker.js:71

Reproducible Demo

https://github.com/UlfR/gf_test

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:13
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

25reactions
asCii88commented, Jul 25, 2017

@UlfR why did you close this issue? shouldn’t this be supported in the latest version? isn’t downgrading just a temporary fix?

16reactions
markusguenthercommented, Jul 25, 2017

I had the same issue and solved this by using variables.

export default function * root() {
  let sagaIndex = [
    // some sagas only receive an action
    takeLatest(StartupTypes.STARTUP, startup)
  ];

  yield sagaIndex;
};

becomes:

const rootSaga = function * root() {
  let sagaIndex = [
    // some sagas only receive an action
    takeLatest(StartupTypes.STARTUP, startup)
  ];

  yield sagaIndex;
};

export default rootSaga;
Read more comments on GitHub >

github_iconTop Results From Across the Web

react native generator function not working - Stack Overflow
If a Token exists then I want it display with console.log. But nothing happens why? I also get no errors. getToken.js import *...
Read more >
unable to resolve module react-native-elements - You.com
You are exporting the CustomButton component as a default export. But on App.js , you are importing it as a named import. So,...
Read more >
Compare Versions | react-native | npm - Open Source Insights
A framework for building native apps using React ... @babel/plugin-proposal-async-generator-functions 7.20.1 ... is-unicode-supported 0.1.0.
Read more >
@polkadot/react-api | Yarn - Package Manager
@polkadot/ui. Basic browser and framework agnostic UI components for creating apps using the polkadot{.js} libraries ...
Read more >
Changelog and Migration Guide - Detekt
#5089; We added support for generating custom configuration for rule ... detektVersionReplace.js plugin is not replacing all [detekt_version] tags on ...
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