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

Collection widget content gets deleted on page load completion with ghcjs #404

Open
tek opened this issue Aug 25, 2020 · 0 comments
Open
Labels

Comments

@tek
Copy link
Contributor

tek commented Aug 25, 2020

Not quite sure whether this is an obelisk problem instead, but this code:

  dynText (pure "zero")
  void $ simpleList (pure ["one"]) (dyn_ . fmap text)
  void $ listWithKey (pure (() =: "two")) (const (el "p" . dynText))

renders the three strings while loading, then "one" and "two" disappear.
This only happens when cross-compiling; with jsaddle, the behaviour is as expected.

test case project here: https://github.com/tek/reflex-bug-1

Run with jsaddle: ob run
Run with ghcjs:

cd $(nix-build -A exe)
./backend

Additional twist:
When I discovered this in a real world case, I used listWithKey with a Map of maybe 20 elements. In that case, it doesn't render none of the elements, but only one. It is the one that shows up as the last element of the list when printing the Dynamic t (Map ...)) with traceDyn.
Furthermore, this only happens on page load; when navigating to a different route (Obelisk), the entire thing is rendered (In this case, the data is populated by getPostBuild and EventWriter, but apparently that is not necessary for the bug to appear)

@3noch 3noch added the bug label Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants