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.

Build failure for OnUpdateState with ComponentContext isn't useful

See original GitHub issue

Version

0.15.0

Issues and Steps to Reproduce

Make a ComponentSpec with an @OnUpdateState method and put ComponentContext as the first argument. The build failure does not describe the reason the build fails. It doesn’t even point to the Component causing the issue.

screen shot 2018-06-23 at 10 04 26 am

The @OnUpdateState method which broke the build was in VehicleSelectionComponentSpec, which isn’t even mentioned in the build failure.

Expected Behavior

Build failure clearly indicates the problematic method.

Link to Code

@OnUpdateState
    static void onUpdateVehicleList(
        ComponentContext c,
        StateValue<Set<Long>> vehicles,
        @Param Set<Long> updatedVehicles) {
        vehicles.set(updatedVehicles);
    }

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
pavlosptcommented, Jun 23, 2018

Ok will try to reproduce tonight and see if I can prepare a fix!

0reactions
mihaelaocommented, Jun 19, 2019

Checked and error message appears correct when building now, closing

Read more comments on GitHub >

github_iconTop Results From Across the Web

Attempt to update state onClick results in "this.setState is not a ...
You're getting this error because the keyword this is not pointing to your component's execution context and it's current execution context ...
Read more >
Basics | Litho
Transition is a description of which Component/Property (mandatory) and how (optional) you want to animate. You will not use a constructor to create...
Read more >
Validate Compound Component Context Consumers
If someone uses one of our compound components outside the React.createContext `, they will experience a confusing error. We could provide a default...
Read more >
State in Specs | Litho
This page introduces the concept of state in a component written using the Java Spec API, namely a @LayoutSpec or @MountSpec.
Read more >
How to manage or eliminate React state without Redux
Export state management functions alongside components; Build more ... products whenever I make a change, because I have to update the ...
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