Turbo will not navigate to URLs that have a `.` in the pathname
See original GitHub issueIt looks like that this behavior is intended, guessing it prevents Turbo from running when users are downloading a file. The problem is that routes with .
are valid in Rails routes, so, if you tried to navigate to routes like:
- https://github.com/hotwired/turbo/releases/tag/v7.1.0
- https://github.com/hotwired/turbo/blob/main/CONTRIBUTING.md
Turbo won’t even try to navigate to them.
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:17 (9 by maintainers)
Top Results From Across the Web
How do I parse a URL into hostname and path in javascript?
The first argument is a relative or absolute URL; if it's relative, then you need to specify the second argument (the base URL)....
Read more >URL.pathname - Web APIs - MDN Web Docs
The pathname property of the URL interface represents a location in a hierarchical structure. It is a string constructed from a list of...
Read more >Lazy-loaded frame - Turbo Reference
src accepts a URL or path value that controls navigation of the element · loading has two valid enumerated values: “eager” and “lazy”....
Read more >Routing - Remix
When there is no child route to render, we render the index route. Consider the URL example.com/sales . If our app didn't have...
Read more >Client Component Hooks: usePathname - Next.js beta docs
'use client'; import { usePathname } from 'next/navigation'; export default function Page() { // When URL is /blog/hello, pathname = '/blog/hello' // When ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@2called-chaos It doesn’t. I think that this is a separate bug/issue. Right now its value could be
true
orfalse
but I think it should accept 3 valuesfalse
- always disable Turbo,default
- run default check (whattrue
does right now) andtrue
- always force Turbo visit (not what it does currently). It probably would be what one would expect from it without studying internals.I have similar project where I have to pass file path as a parameter in a
host/controller/path/to/some/file.txt
format and what I do is I modify isisHTML
to always returntrue
and manually disable likns that aren’t navigable withdata-trubo=false
.Cheers 🍷
Or even simpler than that. Pass basic object to
isVisitable
with attributes reassigned fromURL
and some extras (extension etc).