DTK0006: No Dump Match
Package:
@vitejs/devtools-rpc
Message
No dump match for "
{name}" with args:{args}
Cause
This error is thrown by createClientFromDump() when a function exists in the dump store, but no pre-computed result matches the given arguments. The dump client uses argument hashing to look up results, so the call arguments must exactly match one of the dump.inputs entries. This error only occurs when there is also no fallback configured for the function.
Example
ts
import { defineRpcFunction } from '@vitejs/devtools-kit'
import { createClientFromDump, dumpFunctions } from '@vitejs/devtools-rpc'
const greet = defineRpcFunction({
name: 'my-plugin:greet',
type: 'query',
handler: (name: string) => `Hello, ${name}!`,
dump: {
inputs: [['Alice'], ['Bob']], // only these two inputs are pre-computed
},
})
const store = await dumpFunctions([greet])
const client = createClientFromDump(store)
// Works fine
await client['my-plugin:greet']('Alice') // 'Hello, Alice!'
// Throws DTK0006 because 'Charlie' was not in dump.inputs
await client['my-plugin:greet']('Charlie')Fix
Add the missing input combination to the dump.inputs array, or configure a fallback value for unmatched calls:
ts
// Option 1: Add the missing input
const greet = defineRpcFunction({
name: 'my-plugin:greet',
type: 'query',
handler: (name: string) => `Hello, ${name}!`,
dump: {
inputs: [['Alice'], ['Bob'], ['Charlie']],
},
})
// Option 2: Provide a fallback for unmatched args
const greet = defineRpcFunction({
name: 'my-plugin:greet',
type: 'query',
handler: (name: string) => `Hello, ${name}!`,
dump: {
inputs: [['Alice'], ['Bob']],
fallback: 'Hello, stranger!',
},
})You can also use the onMiss callback in createClientFromDump() to debug which calls are missing:
ts
const client = createClientFromDump(store, {
onMiss: (name, args) => {
console.warn(`Dump miss: ${name}`, args)
},
})Source
packages/rpc/src/dumps.ts