microsoft/playwright · error · Error

Dropping a directory is not supported — pass individual file

Error message

Dropping a directory is not supported — pass individual files.

What it means

Error "Dropping a directory is not supported — pass individual files." thrown in microsoft/playwright.

Source

Thrown at packages/playwright-core/src/client/frame.ts:338

  async click(selector: string, options: channels.FrameClickOptions & TimeoutOptions = {}) {
    return await this._channel.click({ selector, ...options }, this._timeout(options));
  }

  async dblclick(selector: string, options: channels.FrameDblclickOptions & TimeoutOptions = {}) {
    return await this._channel.dblclick({ selector, ...options }, this._timeout(options));
  }

  async dragAndDrop(source: string, target: string, options: channels.FrameDragAndDropOptions & TimeoutOptions = {}) {
    return await this._channel.dragAndDrop({ source, target, ...options }, this._timeout(options));
  }

  async _drop(selector: string, payload: DropPayload, options: Omit<channels.FrameDropOptions, 'payloads' | 'localPaths' | 'streams' | 'data'> & TimeoutOptions = {}) {
    let fileParams: { payloads?: channels.FrameDropParams['payloads'], localPaths?: string[], streams?: channels.FrameDropParams['streams'] } = {};
    if (payload.files !== undefined) {
      const converted = await convertInputFiles(payload.files, this.page().context());
      if (converted.localDirectory || converted.directoryStream)
        throw new Error('Dropping a directory is not supported — pass individual files.');
      fileParams = { payloads: converted.payloads, localPaths: converted.localPaths, streams: converted.streams };
    }
    const dataArray = payload.data ? Object.entries(payload.data).map(([mimeType, value]) => ({ mimeType, value })) : undefined;
    await this._channel.drop({
      selector,
      ...fileParams,
      data: dataArray,
      ...options,
    }, this._timeout(options));
  }

  async tap(selector: string, options: channels.FrameTapOptions & TimeoutOptions = {}) {
    return await this._channel.tap({ selector, ...options }, this._timeout(options));
  }

  async fill(selector: string, value: string, options: channels.FrameFillOptions & TimeoutOptions = {}) {
    return await this._channel.fill({ selector, value, ...options }, this._timeout(options));
  }

View on GitHub (pinned to c8fc3bf8d3)

When it happens

Trigger: Thrown at packages/playwright-core/src/client/frame.ts:338 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of microsoft/playwright@c8fc3bf8d3 (2026-08-12). Data as JSON: /api/errors/8c87ffca7e90da47. Report an issue: GitHub.