You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I was trying to reproduce the examples given in here and I obtain the following error: Page not found: /, route does not link to a (markdown) path or module or component
It seems that using a route without a component is not supported. Is that true ? I read all the unit tests in relation to routing and no one tests the use case where the Route(path"/") does not have a component.
Here is the code that I wrote:
importsolararoutes= [
solara.Route(path="/"),
solara.Route(path="kiwi"),
solara.Route(path="banana"),
solara.Route(path="apple"),
]
@solara.componentdefPage():
route_current, routes=solara.use_route()
solara.Markdown("*Click on one of the links below to change the route and see the url in your browser change, and match the route.*")
withsolara.VBox():
forrouteinroutes:
withsolara.Link(route):
current=route_currentisrouteifcurrent:
solara.Success(f"You are at solara.Route(path={route.path!r})")
else:
solara.Info(f"Go to solara.Route(path={route.path!r})")
I use solara 1.41.0 on MacOS.
Thank you by advance,
T.
The text was updated successfully, but these errors were encountered:
Hi @tdard! Sorry for taking a while to reply - we've had a pretty busy time.
We can get away with not providing a component to the path "/" since the page in question is not the starting point of our execution. Rather, when running the documentation website, we run a parent module of the file in question - to run the documentation website locally, you can use solara run solara.website.pages. This gets the corresponding module from the package solara and executes it, rather than just running a python file. Running a module means that we automatically discover server paths and pick up Page and Layout components from those paths. Since we don't provide a component argument to the routes we defined manually, the one in it's parent file is used automatically. The docs page on understanding routing has some more information.
If you want to play around with / see this in action, I made a minimal example in this repo. If you have any follow up questions, feel free to ask!
Hi, I was trying to reproduce the examples given in here and I obtain the following error:
Page not found: /, route does not link to a (markdown) path or module or component
It seems that using a route without a
component
is not supported. Is that true ? I read all the unit tests in relation to routing and no one tests the use case where theRoute(path"/")
does not have a component.Here is the code that I wrote:
I use solara
1.41.0
on MacOS.Thank you by advance,
T.
The text was updated successfully, but these errors were encountered: