Skip to content

No Handler for Event viewId when view id or state data has new line character #187

@hezhenxing

Description

@hezhenxing

This is a very strange problem, when the data type for View id or state is a list of Text, and the data contains new line character, calling any update handler will result in an error similar to this:

No Handler for Event viewId: Message ["\n"] action: Edit d1c8ab99-45b3-4dad-8a5a-f50563ab9ebd

Here is a snippet of the code:

page :: Page es '[Message]
page = do
  works <- allWorks
  pure $ layout Works $ do
    hyper (Message ["\n"]) $ homeView

data Message = Message [Text]
  deriving (Generic, ViewId)

instance HyperView Message es where
  data Action Message = Hello

  update Hello = do
    pure $ helloView

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions