client-side solid-router prepends every relative link with hash, even when not desired

I am using hashIntegration with the solid-router for an SPA running on our site - but the entire site is not an SPA, and <Link>, <a>, <NavLink> (solid-bootstrap), etc., treat any links as hashed links for the router. E.g., I do not want "/about/home" to go the client solid-router, I want it to go be handled by the .NET MVC router. Yet it doesn't seem to matter what tag I use, the links are automatically converted to "#/about/home", which traps the user inside the SPA. Is there any way I can break out of this by setting something on the tag itself?
15 Replies
mdynnl
mdynnl16mo ago
that's rather strange, <a href="/a/b"> shouldn't be captured by the router probably getting dragged along with hash change how are you serving your app? i think if that path really returns another page, it should work
argimenes
argimenes16mo ago
I've worked around it for now by creating a new link component and using that where I want to avoid routing, but I'd still love to get to the bottom of why these relative paths are being hashed! The interesting thing is that my first attempt at injecting a domain to create an absolute path (i.e., http://localhost/a/b) had no effect at all and was still hashed!
mdynnl
mdynnl16mo ago
probably that path is returning the same page, that's why it got appended with '#'
argimenes
argimenes16mo ago
The SPA is being served on a .NET View. Basically no different from any other hosted page. The base path is: http://arc-core.localhost/arc-forums.
mdynnl
mdynnl16mo ago
could you confirm whether you're using latest solid-router?
argimenes
argimenes16mo ago
I believe so. I did an NPM install today.
mdynnl
mdynnl16mo ago
it used to catch all links, only way to disable that behavior is by adding rel="external" attribute
argimenes
argimenes16mo ago
Although may be I should have done a different kind of update...? I am new to NPM
mdynnl
mdynnl16mo ago
the router also got moved to @solidjs namespace, now @solidjs/router
argimenes
argimenes16mo ago
Yep, that's the one I'm using.
mdynnl
mdynnl16mo ago
and it happens with <a href="/path"> too?
argimenes
argimenes16mo ago
Yeah Not just with Link I thought it would just happen with Link
mdynnl
mdynnl16mo ago
the ones you import from the package, <NavLink/>, <A/>, etc already are setup to be captured by the router, but <a href="/path" wouldn't
argimenes
argimenes16mo ago
I'm progressively enhancing our NET Core MVC site which is why the SPA is being used in this way. Hence my confusion. 😁 I have to sign off for now as it's late here but thanks for your input so far!
mdynnl
mdynnl16mo ago
it probably depends on how the SPA is being served (i would start here), <a href="/some-path"> would just hit the server, the browser continues to do what it does
Want results from more Discord servers?
Add your server
More Posts
Passing signal from one template's function to a different template functionI've been reading so much I think I've confused myself more. If I `createSignal()` in `header.jsx` hMonorepo error with SolidStart `__vite_ssr_import_0__.template is not a function`I've got a shared UI library (compiled into esm + cjs with vite) that is used with both a regular Soundefined context for dynamically added componentHi team, I am coding a toast component. The idea is to expose a `success` method via context. UsersDo we have an ExtractProps helper?Finally have a need for this, but managed to avoid it till now. lolProperty 'pathLength' does not exist on type 'CircleSVGAttributes<SVGCircleElement>'I was trying setting the `pathLength` property but I get the TS error above, not sure if the properEvents (oninput on keyup) stopped working?I just asked in the solid-start channel but this may be a bigger issue than that. I may have done soHow to add calculated getter in a existing store?`const [store, setStore] = createStore({firstName: "Foo", lastName: "Bar"})`using createResource on nodeI am trying to create a `filesystem` primitive that abstracts different file systems (virtual on locTrying to update a value at index in a store array, updates all elementsHello everyone, I'm sorry this is probably gonna be a bit long, I'm having a hard time trying to expRedirect to current location from createServerAction$()I have a logout action that I would like to logout the user without changing the location. My curren