Skip to content

dataconnect-emulator-3.3.1: sdk:generate fails with ImportsTS wrong number of args #10227

Closed

Description

@m47een

Environment info

firebase-tools: 15.12.0
Platform: Linux (WSL2, also reproduces on GitHub Actions Ubuntu runners)
dataconnect-emulator: 3.3.1 (bundled with firebase-tools 15.12.0)

Bug description

firebase dataconnect:sdk:generate fails with a Go template error in dataconnect-emulator-3.3.1. The ImportsTS template function now requires 2 arguments (the second being ClientCache), but the emulator only passes 1.

Steps to reproduce

  1. Install firebase-tools@15.12.0
  2. Have a connector.yaml with javascriptSdk configured (with or without clientCache: {})
  3. Run firebase dataconnect:sdk:generate

Error output

I0331 17:06:10.835010 jsgen.go:146] Embedded file index.d.ts.go.tmpl
E0331 17:06:16.627776 generate_cmd.go:51] Failed to generate SDKs:
[connector "deliverables" javascriptSdk]: failed to generate sources:
failed to parse template: template: index.d.ts.go.tmpl:4:12: executing "index.d.ts.go.tmpl" at <ImportsTS>: wrong number of args for ImportsTS: want 2 got 1

Error: An unexpected error has occurred.

Investigation

Running the emulator with verbose logging (-v=5) confirms:

  • The emulator reads clientCache from connector.yaml correctly:
    "ClientCache": { "MaxAge": "", "MaxSize": "", "Storage": "" }
    
  • But it does not propagate the ClientCache value to the ImportsTS Go template function

The Go template index.d.ts.go.tmpl at line 4 calls ImportsTS which now expects 2 arguments (OperationsUsed and ClientCache), but only receives 1.

Workaround

Pin firebase-tools to 15.11.0, which bundles dataconnect-emulator-3.3.0 (the template works correctly in 3.3.0).

npm install -g firebase-tools@15.11.0

connector.yaml (minimal reproduction)

connectorId: myConnector
generate:
  javascriptSdk:
    - outputDir: ./generated
      package: "@myapp/generated"
      packageJsonDir: .
      clientCache: {}

Expected behaviour

SDK generation should succeed, as it does with dataconnect-emulator-3.3.0.

Actual behaviour

SDK generation fails with the ImportsTS template error regardless of whether clientCache is present in connector.yaml.

Activity

  1. added
    emulator: dataconnect
    on Mar 31, 2026
  2. aalej commented on Mar 31, 2026

    @aalej
    Contributor

    Hey @m47een thanks for reporting this! I'm currently working on reproducing this, but so far I haven't encountered any issues when running firebase dataconnect:sdk:generate. If you are using a web framework, could you let us know which one you're using(Next, Angular, etc.). This will help us accurately reproduce the error.

    Our engineering team has an idea of what's causing this issue, and we want to make sure that we apply the correct fix.

  3. m47een commented on Apr 1, 2026

    @m47een
    Author

    Hi @aalej, thanks for looking into this!

    We're using Angular 21 (zoneless, standalone components). The javascriptSdk entry has angular: true and react: false. We also generate an adminNodeSdk for Firebase Functions.

    Here are the full config files:

    connector.yaml:

    connectorId: deliverables
    generate:
      javascriptSdk:
        - outputDir: ../../apps/saas-app/src/dataconnect-generated
          package: "@dataconnect/generated"
          packageJsonDir: ../../apps/saas-app
          react: false
          angular: true
      adminNodeSdk:
        outputDir: ../../functions/dataconnect-admin-generated
        package: "@dataconnect/admin"
        packageJsonDir: ../../functions

    dataconnect.yaml:

    specVersion: "v1alpha"
    serviceId: "my-service"
    location: "europe-west2"
    
    schema:
      source: "./schema"
      datasource:
        postgresql:
          database: "my-database"
          cloudSql:
            instanceId: "my-instance"
            schemaValidation: "COMPATIBLE"
    
    connectorDirs:
      - "./deliverables-connector"

    The error occurs with firebase-tools@15.12.0 on both WSL2 (Linux 6.6.87) and GitHub Actions Ubuntu runners. Pinning to firebase-tools@15.11.0 (which uses dataconnect-emulator-3.3.0) works fine.

    Note: adding clientCache: {} to the javascriptSdk config doesn't help — the emulator reads it (confirmed via -v=5 logging) but still fails at the template level.

  4. aalej commented on Apr 1, 2026

    @aalej
    Contributor

    Thanks @m47een for the additional info! It looks like the issue occurs when generating code for Angular. I'll mark this issue as reproducible and share an mcve here.

  5. stephenarosaj commented on Apr 1, 2026

    @stephenarosaj
    Contributor

    Thanks @m47een for the report and @aalej for the investigation! We have a fix for this coming - we'll update you when it releases :P

  6. joehan commented on Apr 9, 2026

    @joehan
    Member

    Closing as fixed by #10290 - this will go out in today's release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

emulator: dataconnectreproducible

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions