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

Hooks don't work after standard install and configuration #284

Closed
michaelterryio opened this issue Apr 8, 2023 · 4 comments
Closed

Hooks don't work after standard install and configuration #284

michaelterryio opened this issue Apr 8, 2023 · 4 comments

Comments

@michaelterryio
Copy link

The reference fly.io deploy emits the same warnings/errors that I'm seeing in my app.

See phenixdigital/phoenix_storybook_demo#4

@michaelterryio
Copy link
Author

michaelterryio commented Apr 8, 2023

Embedding stories in an iframe avoids the problem, so for now we can follow the guide here:

https://hexdocs.pm/phoenix_storybook/sandboxing.html#4-enabling-iframe-rendering

...e.g.:

defmodule MyAppWeb.Storybook.AlpineComponent do
  use PhoenixStorybook.Story, :live_component

  def component, do: MyAppWeb.Components.Alpine
  def description, do: "Generic Alpine component"
  def attributes, do: [
    %Attr{id: :id, type: :string},
    %Attr{id: :name, type: :string, required: true},
    %Attr{id: :data, type: :map, required: true}
  ]
  def slots, do: []

+  def container do
+    :iframe
+  end

  def variations, do: [
    %Variation{
      id: :default,
      attributes: %{
        name: "foobox",
        data: %{foo: "bar"}
      }
    }
  ]
end

@danturn
Copy link

danturn commented Apr 12, 2023

Im having the same issue in our app with Hooks :(

@justlampin
Copy link
Contributor

@michaelterryio @danturn it looks like this was fixed in v0.5.3, which hasn't been released yet: daf7bfc

you could get the fix now by pulling your dependency from github, e.g. in mix.exs:
{:phoenix_storybook, github: "phenixdigital/phoenix_storybook"}

in which case you'll need to run mix dev.storybook to build the static assets (the release from hex.pm has them prebuilt, the github dependency does not)

@michaelterryio
Copy link
Author

Ya know, I actually saw that issue, I think coming off Google, and it didn't occur to me that it was prerelease. Thanks.

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

3 participants