fx not usable in restricted Go runtime environments due to syscall reference
Author: jacob-pascualCreated Oct 18, 2019Updated Jun 18, 2026
Because fx imports syscall, it is not available in certain restricted environments like Google App Engine Standard, or the Go Playground. It would be nice if there was a subpackage or version of fx that does not import syscall to be usable with these SDKs.
https://play.golang.org/p/bje5kXCFFWy
go: finding go.uber.org/fx v1.9.0
go: downloading go.uber.org/fx v1.9.0
go: extracting go.uber.org/fx v1.9.0
go: finding go.uber.org/multierr v1.2.0
go: finding go.uber.org/dig v1.7.0
go: downloading go.uber.org/multierr v1.2.0
go: downloading go.uber.org/dig v1.7.0
go: extracting go.uber.org/multierr v1.2.0
go: extracting go.uber.org/dig v1.7.0
go: finding go.uber.org/atomic v1.4.0
go: downloading go.uber.org/atomic v1.4.0
go: extracting go.uber.org/atomic v1.4.0
# go.uber.org/fx
../gopath996126562/pkg/mod/go.uber.org/[email protected]/app.go:458:35: undefined: syscall.SIGTERM
../gopath996126562/pkg/mod/go.uber.org/[email protected]/shutdown.go:50:31: undefined: syscall.SIGTERM
Go build failed.Source: uber-go/fx