You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we use fx.Annotate to annotate a function but that function runs into an error during provide, it errors out like this:
writer.go:40: [Fx] Error after options were applied: fx.Provide(fx.Annotate(go.uber.org/fx_test.TestModuleSuccess.func3.2(), fx.ResultTags(["name: \"badLogger\""])) from:
go.uber.org/fx_test.TestModuleSuccess.func3
/Users/sungyoon/go/src/github.com/uber-go/fx/module_test.go:89
testing.tRunner
/usr/local/go/src/testing/testing.go:1259
Failed: cannot provide function "reflect".makeFuncStub (/usr/local/go/src/reflect/asm_arm64.s:12): cannot provide *fx_test.Logger from [0].Field0: already provided by "reflect".makeFuncStub (/usr/local/go/src/reflect/asm_arm64.s:12)
writer.go:40: [Fx] LOGGER Initialized custom logger from go.uber.org/fx/fxtest.New.func1()
app.go:46: fx.New failed: fx.Provide(fx.Annotate(go.uber.org/fx_test.TestModuleSuccess.func3.2(), fx.ResultTags(["name: \"badLogger\""])) from:
go.uber.org/fx_test.TestModuleSuccess.func3
/Users/sungyoon/go/src/github.com/uber-go/fx/module_test.go:89
testing.tRunner
/usr/local/go/src/testing/testing.go:1259
Failed: cannot provide function "reflect".makeFuncStub (/usr/local/go/src/reflect/asm_arm64.s:12): cannot provide *fx_test.Logger from [0].Field0: already provided by "reflect".makeFuncStub (/usr/local/go/src/reflect/asm_arm64.s:12)
As shown above, the error logs point to [0].Field0: already provided by "reflect".makeFuncStub as where the function was provided from, which can't be easily tracked down cause that's the reflect package's caller frame.
This may be fixed using Dig's LocationForPC ProvideOption.
The text was updated successfully, but these errors were encountered:
When we use
fx.Annotate
to annotate a function but that function runs into an error during provide, it errors out like this:As shown above, the error logs point to
[0].Field0: already provided by "reflect".makeFuncStub
as where the function was provided from, which can't be easily tracked down cause that's the reflect package's caller frame.This may be fixed using Dig's LocationForPC ProvideOption.
The text was updated successfully, but these errors were encountered: