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.

Binding { type: 'once', ... } fires Query.off which returns an error

See original GitHub issue

Hi there!

I get an error after binding the data once, like this:

@firebaseConnect((props) => ([
  { type: 'once', path: DH.getUserProfile(props.uid) },
  { type: 'once', path: DH.getUserGoalsPath(props.uid) },
]))

Below is the error I get:

database.js:130 Uncaught Error: Query.off failed: first argument must be a valid event type: "value", "child_added", "child_removed", "child_changed", or "child_moved".
    at jf (http://localhost:8080/index.js:37664:156)
    at U.g.Ic (http://localhost:8080/index.js:37707:59)
    at unsetWatcher (http://localhost:8080/index.js:36456:46)
    at unWatchEvent (http://localhost:8080/index.js:34494:35)
    at http://localhost:8080/index.js:34516:13
    at Array.forEach (native)
    at unWatchEvents (http://localhost:8080/index.js:34515:18)
    at FirebaseConnect.componentWillUnmount (http://localhost:8080/index.js:31687:37)
    at http://localhost:8080/index.js:23652:26
    at measureLifeCyclePerf (http://localhost:8080/index.js:23318:13)

I figure this is because ‘once’ does not have any watchers which should be unset. However, couldn’t find a fix in the code. Would appreciate your help on this one!

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
DeividasKcommented, Jan 23, 2017

Fix works.

0reactions
prescottpruecommented, Jan 23, 2017

Great to hear! Planning on releasing v1.2.0 in a few minutes (which will include this fix).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Database Engine events and errors - SQL Server
Consult this MSSQL error code list to find explanations for error messages for SQL Server database engine events.
Read more >
Prepared statements and bind_param error handling
In short, error handling is done on the query (and its execution) and not on the binding. Consult the manual on bind_param() :....
Read more >
SQL Query Binding – Scalar Query and Fallback
SQL Query Binding – Scalar Query and Fallback: Learn how to bind a scalar property to a SQL query and return the fallback...
Read more >
5 Binding and Defining
A second type of bind is known as a positional bind. In a positional bind, ... Query statements return data from the database...
Read more >
Property Binding Types - Ignition User Manual 7.9
The blue code is a property binding inside of the query binding. Every time this (event-based) binding fires, the query will run again....
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