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't find variable: document #838

Closed
bhatti opened this issue Apr 14, 2015 · 3 comments
Closed

Can't find variable: document #838

bhatti opened this issue Apr 14, 2015 · 3 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@bhatti
Copy link

bhatti commented Apr 14, 2015

I am using react-native 0.3.4 and trying to integrate a 3rd party library lighstreamer (http://www.lightstreamer.com/distros/Lightstreamer_Allegro-Presto-Vivace_6_0_20150213/Lightstreamer/DOCS-SDKs/sdk_client_javascript/tools/generator.html). I tried using namedspace version of the library but my application gets "Can't find variable: document" when I include that library using require tag. Is there a way to fix this?

@siuying
Copy link

siuying commented Apr 14, 2015

There is no document in React Native's JavaScriptContext, its not a web page. It might be easier to work to write a native module and bridge it.

@brentvatne
Copy link
Collaborator

@bhatti - @siuying is right, there is no document var in the context where JS executes for react-native. I had a look at the source that was generated and unfortunately it was minified, so it was very tough to tell what might be required to add support for it. If you're in the market for a websocket library, you might want to have a look at RCTWebsocket and keep an eye on #619. Good luck!

@ustcqidi
Copy link

ustcqidi commented Dec 6, 2016

@brentvatne

I am using react-native 0.33.0. I have not tried any 3rd party library, but my application gets "Can't find variable: document". Is there a way to fix this?

This is the stack trace , which is captured and sent from online customer's Device. I have not reproduced locally.

Error Domain=RCTErrorDomain Code=1 "Unhandled JS Exception: ReferenceError: Can't find variable: document" UserInfo={NSLocalizedFailureReason={"line":1,"column":43,"sourceURL":"http://static.iqiyi.com/js/demo/PaopaoSignCalenderRN/index.ios.bundle.js"}, NSLocalizedDescription=Unhandled JS Exception: ReferenceError: Can't find variable: document, RCTJSStackTraceKey=(
{
column = 0;
file = "http://static.iqiyi.com/js/demo/PaopaoSignCalenderRN/index.ios.bundle.js";
lineNumber = 1;
methodName = "";
}
)}

@facebook facebook locked as resolved and limited conversation to collaborators May 29, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants