What does it mean when a tags don't navigate to their href?

I have a tags with valid hrefs and they're not disabled or abything like that but sometimes when I click on them, the solid app doesn't navigate to the new route. The way I get around this is to disable scripts or to restart the dev server. How do I prevent this annoying behavior? "@solidjs/meta": "0.29.4", "@solidjs/router": "^0.15.0", "@solidjs/start": "^1.0.10",
3 Replies
Madaxen86
Madaxen863d ago
Page refresh does not help? When you are afk for too long, the browser disconnects from vite. Simple page refresh will log vite connected.
Erik Demaine
Erik Demaine3d ago
Are you using <a> or <A>?
mileung
mileungOP3d ago
I tried both tags, and get the same problem. Not afk, just coding like usual. It seems the problem comes from this line:
let i18n = createAsync(() => new Promise((res) => res({ test: 'Test' })));
let i18n = createAsync(() => new Promise((res) => res({ test: 'Test' })));
where () => new Promise((res) => res({ test: 'Test' })) is supposed to be a server function that gets a language dict, but I replaced it with a promise for testing. let i18n = createAsync(() => getI18nDict(lang())); is what I'm trying to have, but seems just having a promise is enough to cause the issue I think I solved the problem, The component with said problematic line was put
<Router
root={(props) => (
<MetaProvider>
<Suspense>
/* HERE */
<div class="flex-1">{props.children}</div>
<Footer />
</Suspense>
</MetaProvider>
)}
>
<Router
root={(props) => (
<MetaProvider>
<Suspense>
/* HERE */
<div class="flex-1">{props.children}</div>
<Footer />
</Suspense>
</MetaProvider>
)}
>
I moved it inside to a child component and the issue seems to be resolved. Is this expected behavior? Was I doing something wrong at first? Adding Link meta tags also causes routing to stop working
Want results from more Discord servers?
Add your server