Skip to content

firebase dataconnect:sdk:generate fails with "unexpected error" #9942

@coolhandpro

Description

@coolhandpro

firebase-tools version: 15.6.0

firebase.json:
{
"dataconnect": {
"source": "dataconnect"
}
}

dataconnect/dataconnect.yaml:
location: us-central1
schema: schema/schema.gql
connector: gcp-postgresql

dataconnect/schema/schema.gql:

Data Connect schema for the Flooring Quote Pro application.

The 'Query' type defines the entry points for read operations.

While Data Connect auto-generates queries for tables, the type must be declared.

type Query {

Placeholder to ensure the Query type is valid.

_placeholder: String
}

The 'User' table stores information about the application's users.

It is keyed by the Firebase Auth UID.

type User @table {
id: String! @default(expr: "auth.uid")
email: String! @unique
createdAt: Timestamp! @default(expr: "request.time")
updatedAt: Timestamp! @default(expr: "request.time")
}

The 'Project' table stores information about the projects created by users.

type Project @table {
id: UUID! @default(expr: "uuidV4()")
user: User!
projectName: String!
projectType: String
createdAt: Timestamp! @default(expr: "request.time")
updatedAt: Timestamp! @default(expr: "request.time")
}

The 'Quote' table stores the quotes generated for each project.

type Quote @table {
id: UUID! @default(expr: "uuidV4()")
project: Project!
quoteData: String
createdAt: Timestamp! @default(expr: "request.time")
updatedAt: Timestamp! @default(expr: "request.time")
}

The following are custom mutations added to the schema.

type Mutation {

Updates the name of a project.

updateProject(id: UUID!, projectName: String!): Project
@auth(level: "private")
@db(kind: "postgresql", statement: """
UPDATE projects
SET project_name = :projectName, updated_at = now()
WHERE id = :id AND user_id = :auth.uid
RETURNING *;
""")

Deletes a project.

deleteProject(id: UUID!): Project
@auth(level: "private")
@db(kind: "postgresql", statement: """
DELETE FROM projects
WHERE id = :id AND user_id = :auth.uid
RETURNING *;
""")
}

Debug Output:
[2026-02-18T21:37:12.060Z] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at Object.join (node:path:1251:7)
at /home/user/.global_modules/lib/node_modules/firebase-tools/lib/dataconnect/load.js:52:32
at Array.map ()
at load (/home/user/.global_modules/lib/node_modules/firebase-tools/lib/dataconnect/load.js:51:51)
at async Promise.all (index 0)
at async loadAll (/home/user/.global_modules/lib/node_modules/firebase-tools/lib/dataconnect/load.js:44:12)
at async pickServices (/home/user/.global_modules/lib/node_modules/firebase-tools/lib/dataconnect/load.js:29:26)
at async loadAllWithSDKs (/home/user/.global_modules/lib/node_modules/firebase-tools/lib/commands/dataconnect-sdk-generate.js:75:26)
at async Command.actionFn (/home/user/.global_modules/lib/node_modules/firebase-tools/lib/commands/dataconnect-sdk-generate.js:51:32)

Error: An unexpected error has occurred.

[REQUIRED] Environment info

firebase-tools:

Platform:

[REQUIRED] Test case

[REQUIRED] Steps to reproduce

[REQUIRED] Expected behavior

[REQUIRED] Actual behavior

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions