FlowiseAI/Flowise · error · Error

Please install replicate as a dependency with, e.g. `yarn ad

Error message

Please install replicate as a dependency with, e.g. `yarn add replicate`

What it means

The static imports() dynamically imports the replicate package; if resolution fails it re-throws with this install hint. Runtime module-resolution failure, not a network error.

Source

Thrown at packages/components/nodes/llms/Replicate/core.ts:105

            // stream is done
            if (chunk.event === 'done')
                yield new GenerationChunk({
                    text: '',
                    generationInfo: { finished: true }
                })
        }
    }

    /** @ignore */
    static async imports(): Promise<{
        Replicate: typeof ReplicateInstance
    }> {
        try {
            const { default: Replicate } = await import('replicate')
            return { Replicate }
        } catch (e) {
            throw new Error('Please install replicate as a dependency with, e.g. `yarn add replicate`')
        }
    }

    private async _prepareReplicate(): Promise<ReplicateInstance> {
        const imports = await Replicate.imports()

        return new imports.Replicate({
            userAgent: 'flowise',
            auth: this.apiKey
        })
    }

    private async _getReplicateInput(replicate: ReplicateInstance, prompt: string) {
        if (this.promptKey === undefined) {
            const [modelString, versionString] = this.model.split(':')
            if (versionString) {
                const version = await replicate.models.versions.get(modelString.split('/')[0], modelString.split('/')[1], versionString)
                const openapiSchema = version.openapi_schema

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Install the package: yarn add replicate (or pnpm add replicate).
  2. Rebuild/redeploy so node_modules contains the package.
  3. Verify resolution: node -e "require.resolve('replicate')".

Example fix

// before: replicate missing
// after
yarn add replicate
Defensive patterns

Strategy: validation

Validate before calling

try { require.resolve('replicate') }
catch { throw new Error('Run: yarn add replicate before using the Replicate node') }

Type guard

async function replicateAvailable(): Promise<boolean> {
  try { await import('replicate'); return true } catch { return false }
}

Try / catch

try {
  const { default: Replicate } = await import('replicate')
} catch {
  throw new Error('Install replicate to use this node')
}

Prevention

When it happens

Trigger: First _call/_prepareReplicate triggers imports(); the replicate npm package is missing from node_modules in the deployment.

Common situations: Trimmed build that excluded optional deps; production image built without installing the components package's dependencies; monorepo hoisting issue.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/06542a53e241203b. Report an issue: GitHub.