FlowiseAI/Flowise · error · Error
Please install huggingface as a dependency with, e.g. `pnpm
Error message
Please install huggingface as a dependency with, e.g. `pnpm add @huggingface/inference`
What it means
The static imports() method dynamically imports @huggingface/inference; if the module cannot be resolved it re-throws with this install hint. This is a runtime dependency-resolution failure, not a network error.
Source
Thrown at packages/components/nodes/llms/HuggingFaceInference/core.ts:110
},
inputs: prompt
}
if (!this.endpoint) {
obj.model = this.model
}
const res = await this.caller.callWithOptions({ signal: options.signal }, hfClient.textGeneration.bind(hfClient), obj)
return res.generated_text
}
/** @ignore */
static async imports(): Promise<{
HfInference: typeof import('@huggingface/inference').HfInference
}> {
try {
const { HfInference } = await import('@huggingface/inference')
return { HfInference }
} catch (e) {
throw new Error('Please install huggingface as a dependency with, e.g. `pnpm add @huggingface/inference`')
}
}
}
View on GitHub (pinned to abe4a8601a)
Solutions
- Install the package in the components workspace: pnpm add @huggingface/inference.
- Rebuild/redeploy the image so node_modules includes the package.
- Confirm it resolves at runtime: node -e "require.resolve('@huggingface/inference')".
Example fix
// before: @huggingface/inference missing from package.json // after pnpm --filter flowise-components add @huggingface/inference
Defensive patterns
Strategy: validation
Validate before calling
// Fail fast at boot if the optional dependency is missing
try { require.resolve('@huggingface/inference') }
catch { throw new Error('Run: pnpm add @huggingface/inference before using HuggingFaceInference') } Type guard
async function huggingfaceAvailable(): Promise<boolean> {
try { await import('@huggingface/inference'); return true } catch { return false }
} Try / catch
try {
const { HfInference } = await import('@huggingface/inference')
} catch {
// degrade gracefully or instruct the user to install the dependency
throw new Error('Install @huggingface/inference to use this node')
} Prevention
- Declare @huggingface/inference in the components package.json dependencies.
- Run require.resolve checks in a boot smoke test.
- Rebuild production images after adding the dependency.
- Verify optional deps are not tree-shaken out of the bundle.
When it happens
Trigger: First _call() to the HuggingFaceInference node triggers imports(); the @huggingface/inference package is absent from node_modules in the running deployment.
Common situations: Custom/trimmed Flowise build that omitted the optional dependency; production image built without install of the components package deps; monorepo hoisting removed the package; package renamed/removed.
Related errors
- Please install replicate as a dependency with, e.g. `yarn ad
- Please install huggingface as a dependency with, e.g. `pnpm
- Please install chromadb as a dependency with, e.g. `npm inst
- HuggingFace API key is required. Please configure it in the
- Please set an API key for HuggingFace Hub. Either configure
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/57edbcda09d4d770.
Report an issue: GitHub.