Closed zoedsoupe closed 8 months ago
hey Zoey, sorry I hadn't much time lately to work on the storybook, but I'm now tackling all open issues. Is your issue still relevant? If so, I can help this week
yes, it is!
Ok, I’ll try to reproduce your error tomorrow!
Hey Zoey, it took me a couple of hours to dig down to the issue, but the problem was you are not providing the storybook a LiveView endpoint.
I fixed it with:
diff --git a/apps/design_system/lib/design_system/endpoint.ex b/apps/design_system/lib/design_system/endpoint.ex
index 07356ee..62a1513 100644
--- a/apps/design_system/lib/design_system/endpoint.ex
+++ b/apps/design_system/lib/design_system/endpoint.ex
@@ -12,5 +12,7 @@ defmodule DesignSystem.Endpoint do
key: "_design_system_key",
signing_salt: "OBcQb8Zm"
+ socket("/design-system/live", Phoenix.LiveView.Socket)
+
plug DesignSystem.Router
end
diff --git a/apps/design_system/lib/design_system/router.ex b/apps/design_system/lib/design_system/router.ex
index 7bcca04..f404532 100644
--- a/apps/design_system/lib/design_system/router.ex
+++ b/apps/design_system/lib/design_system/router.ex
@@ -8,7 +8,8 @@ defmodule DesignSystem.Router do
live_storybook("/design-system/storybook",
backend_module: DesignSystem.Storybook,
- assets_path: "/design-system/storybook/assets"
+ assets_path: "/design-system/storybook/assets",
+ live_socket_path: "/design-system/live"
)
end
end
Let me know if it's working for you!
I'm closing, feel free to re-open if you are still stuck with this issue.
I have an umbrella app which has many web apps of different domains. However, I would like to extract common components and styles to a separate application called
:design_system
.To correctly forward and handle different paths request I also have a
:proxy_web
app that forwards to the respective endpoint based on theconn.path_info
pattern.Here's the
ProxyWeb
main part, the router:Thats works fine, but
phoenix_storybook
has a strange behaviour.In my
:design_system
app I define the router as:So now I'm able to reach
/design-system/storybook/assets/css/app.css
for example, in the browser!However, when I reach to
/design-system/storybook
the page reloads infinitely because the conn is halted on theAssetNotFoundController
ofphoenix_storybook
The partial log is
Sample Video
https://github.com/phenixdigital/phoenix_storybook/assets/44469426/e7669a9e-4e71-415a-b11c-3a5ef8f94d6d
The complete source code can be found at https://github.com/peapescarte/pescarte-plataforma/tree/feat/design-system-app