-
Notifications
You must be signed in to change notification settings - Fork 404
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Duplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior 😯
I'm trying to use query() with createAsync() in one of my page. Like the following,
// routes/(baseLayout)/index.tsx
import { createAsync, query, redirect, RouteDefinition } from "@solidjs/router";
import { Dialog } from "~/components/Dialog";
const getQuote = query(async () => {
const quote = await fetch("https://zenquotes.io/api/random");
throw redirect("/auth/signin");
}, "posts");
function DialogTrigger() {
return <div>Open dialog</div>;
}
export const route = {
info: {
breadcrumbs: {
label: "Home",
path: "/",
},
},
} satisfies RouteDefinition;
export default function Home() {
const quote = createAsync(() => getQuote());
return (
<div>
{JSON.stringify(quote())}
<Dialog trigger={DialogTrigger} />
</div>
);
}But when i go to the page i got the following error:
I tried to refresh the page over and over again, but no hope. Seems like this will occurred when we have fetch() and redirect() altogether. I've tried to change the query() code with just fetch() or redirect() and it's working as expected.
Expected behavior 🤔
No error occurred.
Steps to reproduce 🕹
Steps:
- Create
query()withfetch()andredirect() - Go to the corresponding page
- The error will appeared.
Context 🔦
No response
Your environment 🌎
System:
- OS: macOS Tahoe 26.0
- CPU: Apple M3
Binaries:
- Node: v22.15.0
npmPackages:
- "@solidjs/router": "^0.15.4",
- "@solidjs/start": "^1.2.0",
- "solid-js": "^1.9.10",
- "vinxi": "^0.5.8"rustaman999
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working