FlowiseAI/Flowise · error · Error
No API key provided
Error message
No API key provided
What it means
SpiderApp constructor guard. With no apiKey (null/undefined/empty) the client cannot authenticate, so it refuses to construct. SpiderLoader passes its apiKey here; this is the lower-level counterpart of error 183.
Source
Thrown at packages/components/nodes/documentloaders/Spider/SpiderApp.ts:52
interface CrawlResponse {
success: boolean
data?: SpiderDocument[]
error?: string
}
interface Params {
[key: string]: any
}
class SpiderApp {
private apiKey: string
private apiUrl: string
constructor({ apiKey = null, apiUrl = null }: SpiderAppConfig) {
this.apiKey = apiKey || ''
this.apiUrl = apiUrl || 'https://api.spider.cloud/v1'
if (!this.apiKey) {
throw new Error('No API key provided')
}
}
async scrapeUrl(url: string, params: Params | null = null): Promise<ScrapeResponse> {
const headers = this.prepareHeaders()
const jsonData: Params = { url, limit: 1, ...params }
try {
const response: AxiosResponse = await this.postRequest('crawl', jsonData, headers)
if (response.status === 200) {
const responseData = response.data
if (responseData[0].status) {
return { success: true, data: responseData[0] }
} else {
throw new Error(`Failed to scrape URL. Error: ${responseData.error}`)
}
} else {
this.handleError(response, 'scrape URL')View on GitHub (pinned to abe4a8601a)
Solutions
- Always pass apiKey: `Bearer ${process.env.SPIDER_API_KEY}` sourced from env.
- Validate the env var at app startup and fail fast with a clear message.
- In tests, inject a dummy key or mock SpiderApp entirely.
Example fix
// before
const app = new SpiderApp({})
// after
const apiKey = process.env.SPIDER_API_KEY
if (!apiKey) throw new Error('SPIDER_API_KEY env var is required')
const app = new SpiderApp({ apiKey }) Defensive patterns
Strategy: validation
Validate before calling
const apiKey = process.env.SPIDER_API_KEY
if (!apiKey) throw new Error('SPIDER_API_KEY env var is required')
const app = new SpiderApp({ apiKey }) Type guard
function isSpiderAppConfig(v: unknown): v is { apiKey: string } {
return typeof (v as any)?.apiKey === 'string' && (v as any).apiKey.length > 0
} Try / catch
try {
new SpiderApp({ apiKey })
} catch (e: any) {
if (/No API key provided/.test(e.message)) {
// redirect to credential setup
}
throw e
} Prevention
- Never instantiate SpiderApp without first asserting the key is present.
- Fail fast on missing env vars at app boot.
- Inject a dummy key or mock in tests.
- Keep this guard aligned with the SpiderLoader constructor guard.
When it happens
Trigger: Constructing `new SpiderApp({})` or `new SpiderApp({ apiKey: null })` directly, or via SpiderLoader when the key resolves to empty. apiUrl defaults to https://api.spider.cloud/v1 so only the key matters.
Common situations: Direct SDK use without reading SPIDER_API_KEY, a credential loader that returns undefined, or tests that instantiate SpiderApp without mocking the key.
Related errors
- Spider API key not set. You can set it as SPIDER_API_KEY in
- Unrecognized mode '${this.mode}'. Expected one of 'crawl', '
- Customer ID is required
- Error: apikeyController.verifyApiKey - apikey not provided!
- chatflowId must be a valid array
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/bb2c2c1562d2523d.
Report an issue: GitHub.