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

[Bug]: onEnded on a gesture crashes client app #1513

Open
victorbjorklund opened this issue Jan 4, 2025 · 1 comment
Open

[Bug]: onEnded on a gesture crashes client app #1513

victorbjorklund opened this issue Jan 4, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@victorbjorklund
Copy link

What happened?

This code:

<Rectangle
style={[
"fill(.red)",
"frame(width: 100, height: 100)",
"offset(x: gesture_state(:drag, .translation.width), y: gesture_state(:drag, .translation.height))",
"animation(.bouncy, value: gesture_state(:drag, .translation.width))",
"animation(.bouncy, value: gesture_state(:drag, .translation.height))",
"gesture(DragGesture().updating(:drag).onEnded(event("handle_swipe")))",
"frame(maxHeight: .infinity)"
]}
/>

Causes the client app to crash on simulator and iPhone. LVN Go works though so seems related to client library.

Library Version

0.4.0

Xcode Version

16.2

Swift Version

6.0.3

On which device or simulator are you running into the problem?

iPhone

Target Device Operating System Version

18.2

Relevant log output

Thread 1: Fatal error: No ObservableObject of type Observer found. A View.environmentObject(_:) for Observer may be missing as an ancestor of this view.

In observedelement.swift:

public var wrappedValue: ElementNode {
    overrideElement ?? observer.resolvedElement
  }
@victorbjorklund victorbjorklund added the bug Something isn't working label Jan 4, 2025
@bcardarella
Copy link
Collaborator

I spoke with Victor in Slack. This is working in 0.3.1 LVN Go but not in 0.4.0-rc.0 in Xcode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants