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

JSON encoding fails on attr argument in alert modifier #90

Open
carson-katri opened this issue Nov 21, 2024 · 2 comments
Open

JSON encoding fails on attr argument in alert modifier #90

carson-katri opened this issue Nov 21, 2024 · 2 comments

Comments

@carson-katri
Copy link

When using the alert modifier with an isPresented:

alert(attr("title"), isPresented: attr("presented"), actions: :actions, message: :message)

Compilation fails with the following error:

** (ErlangError) Erlang error: {:unsupported_type, {:isPresented, {:__attr__, [file: "core_components.swiftui.ex", line: 1, module: "", source: "alert(attr(\"title\"), isPresented: attr(\"presented\"), actions: :actions, message: :message)"], "presented"}}}
        (stdlib 6.1.2) json.erl:199: :json.do_encode/2
        (stdlib 6.1.2) json.erl:244: :json.list_loop/2
        (stdlib 6.1.2) json.erl:241: :json.do_encode_list/2
        (stdlib 6.1.2) json.erl:244: :json.list_loop/2
        (stdlib 6.1.2) json.erl:244: :json.list_loop/2
        (stdlib 6.1.2) json.erl:241: :json.do_encode_list/2
        (stdlib 6.1.2) json.erl:241: :json.do_encode_list/2
        (stdlib 6.1.2) json.erl:257: :json."-do_encode_map/2-lc$^0/1-0-"/2

I don't think stylesheet compilation errors should ever prevent an app from compiling. Instead the styles should be ignored.

@bcardarella
Copy link
Contributor

Can you pull down main on stylesheet and try again? I am not able to reproduce this locally.

Also, I agree with ignoring errors, however I want to wait until we get closer to 0.4 so that compilation issues are more in our face and we can quickly address them.

@bcardarella
Copy link
Contributor

@carson-katri can you confirm if this is stil broken?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants