Skip to content

Playground Generate SQL calls useApiFetcher.ts useCallback with url as an array instead of a string resulting in 404 and failure to display query results #528

@sdoherty000

Description

@sdoherty000

UPDATE: changing services/admin-console/package.json dependencies ai version to "ai": "2.2.33", (around line 38-ish) fixed it for me.

Playground Generate SQL calls useApiFetcher.ts useCallback with url as an array instead of a string resulting in 404 and failure to display query results.

Steps to reproduce:

  1. Databases: choose database tables and scan them.
  2. Playground: enter a NL prompt in the query window and click Generate SQL
  3. The query is sent to the server and saved in the Queries section, but the page does not return the results of the query or display it.
    Some autogenerated string is sent along with the url in an array which is converted to a string and becomes part of the request resulting in the 404
    console error:
    useApiFetcher.ts:59 GET http://localhost:3001/generations/prompts/sql-generations/stream,:r1: 404 (Not Found)
    useApiFetcher.ts:59 GET http://localhost:3000/:r1:,loading 404 (Not Found)
    useApiFetcher.ts:59 GET http://localhost:3000/:r1:,streamData 404 (Not Found)

It seems that this code is being called by playground/index.tsx at useCompletion.
The code for this component is a year old, which suggests the issue may be an incompatibility with a newer version of a dependency like the Vercel AI SDK (ai/react).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions