Comments (3)
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.
@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.
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)
- [Bug?]: client only doesn't work anymore for `props.children` HOT 6
- [Bug?]: Catch-all that starts with number after ellipsis in filename causes hydration errors in nested paths on dev HOT 1
- [Bug?]: Latest Vinxi (>= 0.3.11) causes layout shifts in dev HOT 4
- [Feature?]: Error Handling with solid-router HOT 8
- [Bug?]: Vite server config is being ignored HOT 4
- [Bug?]: Namespaces are completely stripped out of code HOT 4
- [Bug?]: error while importing module, related to `.` in path-name HOT 1
- [Bug?]: createHandler context only called once, renders nonce useless HOT 1
- [Bug?]: Client Only component displayed in app.tsx causes hydration errors HOT 1
- [Bug?]: No value attribute on CSR, but present in SSR HOT 5
- [Bug?]: Typescript error in tsconfig.json for new projects created with pnpm. HOT 1
- Redirect doesn't early exit component when loading from browser address bar HOT 2
- [Bug?]: Frequently generate app.config.timestamp_.js files when i change app.config.js file HOT 1
- [Bug?]: Flakey Hydration Error Key 0-0-0-0-0-0-0-5 HOT 4
- [Bug?]: API routes in file based Route Groups don't work in RC0 HOT 5
- [Bug?]: Extend Solid config causes TS Errors HOT 2
- [Bug?]: Dev server fails to start when installing with new pnpm lockfiles HOT 3
- [Bug?]: The example in the docs doesn't seam to work. HOT 14
- [Bug?]: Issues with API/component routes in routes with parameters in RC1 HOT 3
- [Bug?]: RouteDefinition throw redirect not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solid-start.