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
- Install
firebase-tools@15.12.0
- Have a
connector.yaml with javascriptSdk configured (with or without clientCache: {})
- 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.
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:generatefails with a Go template error indataconnect-emulator-3.3.1. TheImportsTStemplate function now requires 2 arguments (the second beingClientCache), but the emulator only passes 1.Steps to reproduce
firebase-tools@15.12.0connector.yamlwithjavascriptSdkconfigured (with or withoutclientCache: {})firebase dataconnect:sdk:generateError output
Investigation
Running the emulator with verbose logging (
-v=5) confirms:clientCachefromconnector.yamlcorrectly:ClientCachevalue to theImportsTSGo template functionThe Go template
index.d.ts.go.tmplat line 4 callsImportsTSwhich now expects 2 arguments (OperationsUsedandClientCache), but only receives 1.Workaround
Pin
firebase-toolsto 15.11.0, which bundlesdataconnect-emulator-3.3.0(the template works correctly in 3.3.0).connector.yaml (minimal reproduction)
Expected behaviour
SDK generation should succeed, as it does with
dataconnect-emulator-3.3.0.Actual behaviour
SDK generation fails with the
ImportsTStemplate error regardless of whetherclientCacheis present inconnector.yaml.