-
Notifications
You must be signed in to change notification settings - Fork 84
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
Loading 3rd party libs causes errors #34
Comments
Arguably the project maintainer should provide compiled versions. If the project maintainer wants to provide only ES6 version, indeed, the only thing you can do is to add its configuration explicitly to your Webpack config. Which is not nice at all because you don't know the Babel settings expected by the author. |
Thanks for the answer! I do agree with you, unfortunately looks like the problem lives somewhere else. The packager fails at syntax that it normally handles without webpack - destructing (which is widely used in almost all the projects and examples and none of them mentions a single word about ES6 pre-compiling). |
Isn't the packager only used for RN's own modules? |
How I understand that is that packager compiles the whole bundle to one Examples:
In the latest release, they decided to replace |
Yeah, it ignores node_modules and the only solution is to pass selected whitelisted folders via |
@grabbou so do you still want an ES5 version? |
Nope, all works flawlessly with the above config, just wanted to create an issue as excluding |
Ah ok, cool. If you run into any issues with the keyboard event lib, feel free to post at the other repo though :) |
Sorry to jump in late on this one. This has come up a couple times before. node_modules is only excluded for performance reasons in the example project - this is a fairly common setup from what I've seen. I'll update the docs to call this out. Thanks for raising the issue. |
I was having a different (but I think related) error when loading a 3rd party module that required linking and I thought I would drop my solution here since this was the issue my searches brought up. I was trying to require
What I needed to do was make @mjohnston Do you think this is worth calling out in the docs as well? Happy to submit a PR if you think it is. |
Personally, I think it's bad practice for 3rd party modules to rely on the proprietary That being said, if this has become common practice in the react-native ecosystem I'd be happy to accept a PR for a docs update. |
Ah, I had never heard of I've only seen it in two modules, so I think these comments are enough for now. If I keep seeing this I'll reconsider the PR. |
I had the same problem with a 3rd party lib. My solution was to including the prefered modules + my js instead of excluding node_modules.
|
What was the 3rd party lib. I've noticed a lot of react native projects On Tuesday, September 15, 2015, Emil Mork notifications@github.com wrote:
|
@amccloud: It was gb-native-router. Its a fork of react-native-router. And Yes, the library uses es6 syntax. |
I am also getting a |
@sslash react-native-camera needs an native implementation. So, if you havent allready you first need to add the needing resources in xcode. See the 'getting started' section on react-native-camera repo. Also, i have turned back to use packager over webpack-server for react-native. The es5 shim is a bit limited, and lack support for android(you cannot change debugging port on android). It does not have hot-loader but you can reload you entire bundle on change using Reload.js, which is good enough for me. |
Yes, I have added all the necessary resources that is described in getting started at the camera repo. I will try to see if using the packager helps! |
@emilmork In an attempt to get this working I tried to run the example app with v0.6.0 and it gives me |
@sslash I would try updating react-native and create a new react-native project from scratch. 'react-native init Test'. Then install react-native-camera and run with packager. |
@emilmork So not use react-native-webpack-server and get awesome hot loading? :( |
@sslash You might use more time debugging webpack-server than hot loading will save you time developing :) If you make react-native-camera work on a fresh prosjekt with packager it might be easier to make it work with webpack-server. |
Are you using at least io >= 2? |
@gaearon silly of me was on 0.12. However using v2.1.0 I am back to the old |
@sslash did you figure out how to get react-native-camera working with rnws? |
@jkyau nopes, didn't bother ;) |
And so on... the only solution is to pass this package via babel.
The text was updated successfully, but these errors were encountered: