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.

singleEvent: true errors out.

See original GitHub issue
 22     firebase.query(
 23         "/profiles",
 24         {
 25             singleEvent: true,
 26             orderBy: {
 27                 type: firebase.QueryOrderByType.CHILD,
 28                 value: 'user_id'
 29             },  
 30                 
 31             range: {
 32                 type: firebase.QueryRangeType.EQUAL_TO,
 33                 value: this.userId
 34             },
 35   
 36             limit: {
 37                 type: firebase.QueryLimitType.LAST,
 38                 value: 1
 39             }
 40         }
 41     ).then((data) => {console.log("YUJUUUU")});
JS: EXCEPTION: Uncaught (in promise): TypeError: Cannot read property 'orderBy' of undefined
JS: ORIGINAL STACKTRACE:
JS: Error: Uncaught (in promise): TypeError: Cannot read property 'orderBy' of undefined
JS:     at resolvePromise (/data/data/org.nativescript.test/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:416:31)
JS:     at resolvePromise (/data/data/org.nativescript.test/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:401:17)
JS:     at /data/data/org.nativescript.test/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:449:17
JS:     at ZoneDelegate.invokeTask (/data/data/org.nativescript.test/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:223:37)
JS:     at Object.NgZoneImpl.inner.inner.fork.onInvokeTask (/data/data/org.nativescript.test/files/app/tns_modules/@angular/core/bundles/core.umd.js:6233:41)
JS:     at ZoneDelegate.invokeTask (/data/data/org.nativescript.test/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:222:42)
JS:     at Zone.runTask (/data/data/org.nativescript.test/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:123:47)
JS:     at drainMicroTaskQueue (/data/data/org.nativescript.test/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:355:35)
JS: Unhandled Promise rejection: Cannot read property 'orderBy' of undefined ; Zone: angular ; Task: Promise.then ; Value: TypeError: Cannot read property 'orderBy' of undefined TypeError: Cannot read property 'orderBy' of undefined
JS:     at /data/data/org.nativescript.test/files/app/tns_modules/nativescript-plugin-firebase/firebase.js:983:18
JS:     at new ZoneAwarePromise (/data/data/org.nativescript.test/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:465:29)
JS:     at Object.firebase.query (/data/data/org.nativescript.test/files/app/tns_modules/nativescript-plugin-firebase/firebase.js:978:10)
JS:     at ProfileService.getUserData (/data/data/org.nativescript.test/files/app/services/profile.service.js:21:18)
JS:     at ProfileService.getUser (/data/data/org.nativescript.test/files/app/services/profile.service.js:17:14)
JS:     at new JobService (/data/data/org.nativescript.test/files/app/services/job.service.js:15:29)
JS:     at DebugAppView._View_Jobs_Host0.createInternal (Jobs_Host.ngfactory.js:22:26)
JS:     at DebugAppView.AppView.create (/data/data/org.nativescript.test/files/app/tns_modules/@angular/core/bundles/core.umd.js:9419:25)
JS:     at DebugAppView.create (/data/data/org.nativescript.test/files/app/tns_modules/@angular/core/bundles/core.umd.js:9631:48)
JS:     at ComponentFactory.create (/data/data/org.nativescript.test/files/app/tns_modules/@angular/core/bundles/core.umd.js:6029:40)
JS: Error: Uncaught (in promise): TypeError: Cannot read property 'orderBy' of undefined

The problem is present only when using singleEvent: true.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
EddyVerbruggencommented, Oct 17, 2016

Yeah, that’s the correct signature.

1reaction
IvRRimumcommented, Oct 17, 2016
 20   private getUserData(userId) {
 21     // TODO: Remove all data from photos$ observable, before pushing new values
 22     firebase.query(
 23         function() {},
 24         "/profiles",
 25         {
 26             singleEvent: true,
 27             orderBy: {
 28                 type: firebase.QueryOrderByType.CHILD,
 29                 value: 'user_id' 
 30             },  
 31             
 32             range: {
 33                 type: firebase.QueryRangeType.EQUAL_TO,
 34                 value: this.userId
 35             },  
 36             
 37             limit: {
 38                 type: firebase.QueryLimitType.LAST,
 39                 value: 1
 40             }   
 41         }   
 42     ).then((data) => {console.log("YUJUUUU")});
 43   }

This works 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Single-event upset - Wikipedia
A single-event upset (SEU), also known as a single-event error (SEE), is a change of state caused by one single ionizing particle (ions,...
Read more >
Single Event Upset Detection and Correction in Virtex-4 and ...
Virtex-4 and Virtex-5 provide a specialized core, called Frame ECC (error correcting code), for detection and identification of single and double-bit errors in ......
Read more >
An event wrapper for data that is exposed via a LiveData that ...
Used as a wrapper for data that is exposed via a LiveData that represents an event. */. open class Event<out T>(private val content:...
Read more >
Neutron-Induced Single Event Upset (SEU) FAQ - Microsemi
A single event upset (SEU) is a bit flip in a memory element of a semiconductor device. ... voting out the error (TMR)...
Read more >
Fixing HTTP 404 errors - Knowledgebase | The Events Calendar
Fixing HTTP 404 errors. On occasion some event pages might start display a 404 – Not found page instead of the events.
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