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

Bundling failed: ReferenceError: ReactNativeRenderGenerator is not defined #195

Closed
ThePJMP opened this issue Aug 15, 2019 · 10 comments
Closed

Comments

@ThePJMP
Copy link

ThePJMP commented Aug 15, 2019

After upgrading vue-native-core (from 0.0.8 to 0.1.2) & react-native version (from 0.55.4 to 0.59.8) bunding failed with following error:

Bundling failed: ReferenceError: ReactNativeRenderGenerator is not defined

Compiling is failing on this line

var renderer = new ReactNativeRenderGenerator(el, options);

After manually changing ReactNativeRenderGenerator to ReactNativeRenderGenerator$1 it says error: bundling failed: ReferenceError: _ is not defined

importObj.imports = _.union(importObj.imports, importModules);

I fixed manually adding lodash, and it worked.

@jgiovanni
Copy link

jgiovanni commented Aug 17, 2019

I came across this same issue, and resolved it the same way, except I replaced _.union with

function union_arrays (x, y) {
  var obj = {};
  for (var i = x.length-1; i >= 0; -- i)
    obj[x[i]] = x[i];
  for (var i = y.length-1; i >= 0; -- i)
    obj[y[i]] = y[i];
  var res = []
  for (var k in obj) {
    if (obj.hasOwnProperty(k))
      res.push(obj[k]);
  }
  return res;
}

@RishabhKarnad
Copy link
Contributor

@ThePJMP did you also upgrade vue-native-helper and vue-native-scripts? The package versions should now always remain the same.

So use

$ npm i --save vue-native-core@0.1.2 vue-native-helper@0.1.2
$ npm i --save-dev vue-native-scripts@0.1.2

@ThePJMP
Copy link
Author

ThePJMP commented Sep 9, 2019

@RishabhKarnad yes. In fact, I'm working with 0.1.3 versions and still having this issue

@RishabhKarnad
Copy link
Contributor

@ThePJMP It looks like this will only happen when using render-prop or render-prop-fn. We're working on it and we'll fix this in the next release (should be out in a few days)

@RishabhKarnad
Copy link
Contributor

This issue has been fixed with release 0.1.4

https://github.com/GeekyAnts/vue-native-core/releases/tag/v0.1.4

@lucasromanojf
Copy link

Somehow vue-native-scripts is loading vue-native-template-compiler version 0.1.3 as dependency and not 0.1.4, and then the error still occurs here, unfortunately.

@ThePJMP
Copy link
Author

ThePJMP commented Sep 23, 2019

Somehow vue-native-scripts is loading vue-native-template-compiler version 0.1.3 as dependency and not 0.1.4, and then the error still occurs here, unfortunately.

You have to upgrade all your vue-native-* dependencies

I can confirm this issue was solved on version 0.1.4

@lucasromanojf
Copy link

I did this. Not sure what I am doing wrong.

@RishabhKarnad
Copy link
Contributor

@lucasromanojf try deleting your yarn.lock or package-lock.json (whichever you are using) and node_modules/ and try reinstalling.

@lucasromanojf
Copy link

@lucasromanojf try deleting your yarn.lock or package-lock.json (whichever you are using) and node_modules/ and try reinstalling.

Coincidentally I had to reinstall my OS, then I cloned the project, deleted the yarn.lock file, ran yarn install and it worked. Not sure if it was cache or the lock file before, but now it is working. Thank you very much!

@RishabhKarnad RishabhKarnad removed their assignment Oct 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants