Ash FrameworkAF
Ash Framework2mo ago
8 replies
Gonzalo Muñoz

AshTypescript: Error: fetch() URL is invalid

Hey guys, I'm trying to consume my autogenerated ash_rpc.ts like it says in the docs, but I'm getting this error. Any clues? Relevant snippets:

priv/cli/src/index.ts
import { scanProjects, listProjects, getByName } from "../../../assets/js/ash_rpc"


priv/cli/src/index.ts
async function cmdScan(path: string): Promise<void> {
    const expandedPath = path.startsWith("~")
        ? path.replace("~", process.env.HOME || "")
        : path

    console.log(`Scanning ${expandedPath}...`)

    const result = await scanProjects({
        input: { path: expandedPath }
    })
    .then(res => {
        console.log("Raw scan result:", res)
        return res
    })
    .catch(err => {
        // ⚠️ We never even get here. It just dies ⚠️
        console.error("Error during scan:", err.message)
        process.exit(1)
    })

    if (result.success) {
        const projects = result.data
        console.log(`Found ${projects.length} projects:`)
        for (const p of projects) {
            const statusIcon = p.status === "ok" ? "✓" : "✗"
            console.log(`  ${statusIcon} ${p.name} [${p.type}]`)
        }
    } else {
        console.error("Failed to scan:", result.errors?.[0]?.message)
        process.exit(1)
    }
}


It's all green, I don't see any type mismatches or even warnings. But clearly I'm doing something wrong
Was this page helpful?