GithubHelp home page GithubHelp logo

Comments (3)

ghalle avatar ghalle commented on May 20, 2024

I can confirm this and also the same thing happens for api routes.

Seems like this happens because links are handled by https://github.com/solidjs/solid-app-router while files inside the public folder and api routes are not known by solid-app-router.

API routes also do not currently support parametric and wildcard routes like regular routes since that part is also handled by solid-app-router. I was about to make a PR for that but I'm now thinking there needs to be a bigger change to consolidate how routing works.

EDIT: Thought a bit more about it. This would require the client knowing all the files in the public directory / all the api routes, which I'm not sure is a good idea. Or not being able to handle 404s client-side without verifying with the server.

EDIT 2: This could probably be handled by some attribute on the <a> indicating that routing should be handled by the server not sure if there is already support for that.

EDIT 3: Just tried it you can add target _self and it will work correctly.

<a class="nav-link" href="./cv.pdf" target="_self">
  CV
</a>

from solid-start.

ryansolid avatar ryansolid commented on May 20, 2024

@ghalle you are correct. It doesn't make sense for the client router to handle these cases. I believe setting rel="external" or setting target on the link is the easiest way.

We need to get the docs written for this.

from solid-start.

ryansolid avatar ryansolid commented on May 20, 2024

Now that we changed how the router works and it doesn't hijack every anchor I think this is no longer a problem. You can just do what the OP did and it works.

from solid-start.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.