-
-
Notifications
You must be signed in to change notification settings - Fork 241
document.createElement is not a function #1137
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
Comments
Check if you have imports from rxjs/rx. I solved this issue by removing/
replacing all imports from rxjs/rx.
…On 24 Dec 2017 9:02 a.m., "Brian" ***@***.***> wrote:
I get the following error when attempting to run my app:
JavaScript error: file:///app/tns_modules/rxjs/util/Immediate.js:56:82:
JS ERROR TypeError: document.createElement is not a function. (In
'document.createElement('script')', 'document.createElement' is undefined)
This is an app that has been working great for a while, i just attempting
to update the libraries and now this is happening. It seems that
Immediate.js in rxjs is attempting to use document.createElement which
obviously doesn't work in nativeScript.
***** Fatal JavaScript exception - application has been terminated. *****
Native stack trace:
1 0x107f6f7b4 -[TNSRuntime executeModule:referredBy:]
2 0x103f2b4e1 main
3 0x109afed81 start
JavaScript stack trace:
1 ***@***.***:///app/tns_modules/rxjs/util/Immediate.js:56:82
2 ***@***.***:///app/tns_modules/rxjs/util/Immediate.js:30:49
3 ***@***.***:///app/tns_modules/rxjs/util/Immediate.js:208:44
4 ***@***.*** code]
5 ***@***.*** code]
6 @[native code]
7 ***@***.*** code]
8 ***@***.*** code]
9 ***@***.***:///app/tns_modules/rxjs/scheduler/AsapAction.js:7:26
10 ***@***.*** code]
11 ***@***.*** code]
12 @[native code]
13 ***@***.*** code]
14 ***@***.*** code]
15 ***@***.***:///app/tns_modules/rxjs/scheduler/asap.js:2:27
16 ***@***.*** code]
17 ***@***.*** code]
18 @[native code]
19 ***@***.*** code]
20 ***@***.*** code]
21 ***@***.***:///app/tns_modules/rxjs/observable/SubscribeOnObservable.js:8:21
22 ***@***.*** code]
23 ***@***.*** code]
24 @[native code]
25 ***@***.*** code]
26 ***@***.*** code]
27 ***@***.***:///app/tns_modules/rxjs/operators/subscribeOn.js:2:38
28 ***@***.*** code]
29 ***@***.*** code]
30 @[native code]
31 ***@***.*** code]
32 ***@***.*** code]
33 ***@***.***:///app/tns_modules/rxjs/operator/subscribeOn.js:2:28
34 ***@***.*** code]
35 ***@***.*** code]
36 @[native code]
37 ***@***.*** code]
38 ***@***.*** code]
39 ***@***.***:///app/tns_modules/rxjs/add/operator/subscribeOn.js:3:28
40 ***@***.*** code]
41 ***@***.*** code]
42 @[native code]
43 ***@***.*** code]
44 ***@***.*** code]
45 ***@***.***:///app/tns_modules/rxjs/./Rx.js:121:8
46 ***@***.*** code]
47 ***@***.*** code]
48 @[native code]
49 ***@***.*** code]
50 ***@***.*** code]
51 ***@***.******@***.***/quickride-ts-libcore/src/socket/reconnecting.js:3:21
52 ***@***.*** code]
53 ***@***.*** code]
54 @[native code]
55 ***@***.*** code]
56 ***@***.*** code]
57 ***@***.******@***.***/quickride-ts-libcore/src/socket/driver-updates.js:14:29
58 ***@***.*** code]
59 ***@***.*** code]
60 @[native code]
61 ***@***.*** code]
62 ***@***.*** code]
63 ***@***.******@***.***/quickride-ts-libcore/src/socket/index.js:6:17
64 ***@***.*** code]
65 ***@***.*** code]
66 @[native code]
67 ***@***.*** code]
68 ***@***.*** code]
69 ***@***.******@***.***/quickride-ts-libcore/src/index.js:10:17
70 ***@***.*** code]
71 ***@***.*** code]
72 @[native code]
73 ***@***.*** code]
74 ***@***.*** code]
75 ***@***.***:///app/app.module.js:7:37
76 ***@***.*** code]
77 ***@***.*** code]
78 @[native code]
79 ***@***.*** code]
80 ***@***.*** code]
81 ***@***.***:///app/main.js:8:27
82 ***@***.*** code]
83 ***@***.*** code]
84 @[native code]
85 ***@***.*** code]
JavaScript error:
file:///app/tns_modules/rxjs/util/Immediate.js:56:82: JS ERROR TypeError: document.createElement is not a function. (In 'document.createElement('script')', 'document.createElement' is undefined)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1137>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AE2Pttq7AEZsaL6cUaxWt1FxJFFIMN9dks5tDcXUgaJpZM4RL0qi>
.
|
I fixed this my importing things directly like @anuragd7 mentioned. ie: instead of this |
had a similar issue, even with the proposed solution, it didn't work n i had to run |
Even after cleaning my platform. I am unable to run my app. |
Hey @Sharique-Hasan, I has a similar issue. All I had to do was to import all |
I have a similar issue, though I don't believe it is rxjs related in my case. I'm using aws-appsync and when I try to require it I get: JavaScript error: RXJS is installed, but it is not being referenced anywhere in my app. Error-causing code: |
***** Fatal JavaScript exception - application has been terminated. ***** Cannot find app/tns_modules/rxjs/... in my project. What am I doing wrong? Helpful for any help with that! Thanks! |
Hi everyone, just to share that I got the same error as well. Checked all the codes and pretty sure everything already calling from "rxjs/Observable" as suggested. Rebuild the platform produce same result as well :( Appreciate any help.
|
@ashrafaa I was running into the same error as you, down to it coming from |
thanks @interrobrian I ended up downgrade |
@ashrafaa To which version? |
[Solved] using |
@fhackenb did you find a solution? |
@TinusJ npm i --save [email protected] |
@fhackenb did you manage to solve it? |
Nope, I never solved it. I ended up giving up using appsync with NativeScript. But it looks like they have an angular demo now that may be worth checking out. No idea if it works though https://github.com/aws-samples/aws-mobile-appsync-chat-starter-angular |
I managed to solve it by adding an extra condition if checking if
createElement exists in document object. I made changes in rxjs's library
immediate.js
…On Wed, Jul 25, 2018, 7:21 PM fhackenb ***@***.***> wrote:
Nope, I never solved it. I ended up giving up using appsync with
NativeScript. But it looks like they have an angular demo now that may be
worth checking out. No idea if it works though
https://github.com/aws-samples/aws-mobile-appsync-chat-starter-angular
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1137 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACYjwa72feUxazpXCfUS3G0Gs6flzFu4ks5uKH7bgaJpZM4RL0qi>
.
|
I solved this by manually adding the code from here into my |
I get the following error when attempting to run my app:
JavaScript error: file:///app/tns_modules/rxjs/util/Immediate.js:56:82: JS ERROR TypeError: document.createElement is not a function. (In 'document.createElement('script')', 'document.createElement' is undefined)
This is an app that has been working great for a while, i just attempting to update the libraries and now this is happening. It seems that
Immediate.js
in rxjs is attempting to usedocument.createElement
which obviously doesn't work in nativeScript.The text was updated successfully, but these errors were encountered: