Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go build fails when using external verb client with external type #4892

Closed
matt2e opened this issue Mar 18, 2025 · 0 comments · Fixed by #4909
Closed

Go build fails when using external verb client with external type #4892

matt2e opened this issue Mar 18, 2025 · 0 comments · Fixed by #4909
Assignees

Comments

@matt2e
Copy link
Collaborator

matt2e commented Mar 18, 2025

I had the following modules:

  • stocks defines a type called StockPrice
  • stocksdb defines a getLatestPricesClient verb which returns an array of StockPrices
  • another module that tries to call stocksdb.getLatestPricesClient but the build always fails

The build error is due to the types.ftl.go file not having an import for ftlstocks "ftl/stocks"

import (
	"context"
	ftlstockdb "ftl/stockdb"
	"github.com/block/ftl/common/reflection"
	"github.com/block/ftl/go-runtime/server"
)

type ComparePricesClient func(context.Context) error

func init() {
	reflection.Register(

		reflection.ProvideResourcesForVerb(
			ComparePrices,
			server.SourceClient[ftlstockdb.GetLatestPricesClient, []ftlstocks.StockPrice](),
		),
	)
}
@github-actions github-actions bot added the triage Issue needs triaging label Mar 18, 2025
@matt2e matt2e changed the title Go build fails when calling external verb with a request type from a different module Go build fails when using external verb client with external type Mar 18, 2025
@matt2e matt2e self-assigned this Mar 19, 2025
@github-actions github-actions bot removed the triage Issue needs triaging label Mar 19, 2025
@matt2e matt2e closed this as completed in b116fd6 Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant