# Dependency conflict errors when using Agones SDK in runtime module

**URL:** <https://forum.heroiclabs.com/t/dependency-conflict-errors-when-using-agones-sdk-in-runtime-module/423>\
**Category:** Local Setup\
**Tags:** server-framework\
**Created:** [December 31, 2019, 10:19am UTC](https://forum.heroiclabs.com/t/dependency-conflict-errors-when-using-agones-sdk-in-runtime-module/423 "2019-12-31T10:19:15Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![novabyte](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/novabyte/32/1324_2.png) [@novabyte](https://forum.heroiclabs.com/u/novabyte)\
**Post date:** [January 3, 2020, 10:46am UTC](https://forum.heroiclabs.com/t/dependency-conflict-errors-when-using-agones-sdk-in-runtime-module/423/3 "2020-01-03T10:46:07Z")

</div>

Hi @jonbonazza. Thanks for the post on the forums to describe this use case. The error you posted can happen with Go-based Nakama projects so I thought it would be valuable to others to explain in detail.

> “Could not open Go module”,“path”:“/nakama/data/modules/roa-nakama.so”,“error”:“plugin.Open("/nakama/data/modules/roa-nakama"): plugin was built with a different version of package [The Go Programming Language](http://golang.org/x/text/transform)”

The specific package named (i.e. “[The Go Programming Language](http://golang.org/x/text/transform)”) that cannot be loaded changes sometimes based on the dependencies in your plugin project code but the root cause is all for the same reason. When a project is built with Go as a plugin a copy of the Go runtime is bundled with the shared object; it’s covered in detail [here](https://github.com/golang/go/issues/17150).

The result is that Nakama’s copy of the Go runtime and the Go runtime bundled with the shared object of your plugin code must be an **exact match** with its list of dependencies (cached in the binaries via Go mod). This should be straightfoward to match dependencies but becomes trickier because Go mod dependency management uses [minimal version selection](https://github.com/golang/go/wiki/Modules#faqs--minimal-version-selection). This means that it’s difficult to pin transitive dependencies to specific versions. This makes it hard to achieve an exact match of the deps tree.

We have found a useful workaround to pin a transitive dependency without a problem when the code is compiled. I’ve put together my example code.

The `go.mod` file looks like:

```go
module github.com/heroiclabs/agones_nakama

go 1.13

require (
	agones.dev/agones v1.2.0
	github.com/grpc-ecosystem/grpc-gateway v1.11.1
	github.com/heroiclabs/nakama-common v1.3.0
	golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297
	golang.org/x/text v0.3.2
)

```

The main file for the plugin code looks like:

```go
package main

import (
	agones "agones.dev/agones/sdks/go"
	"context"
	"database/sql"
	"github.com/heroiclabs/nakama-common/runtime"

	// NOTE: Do not remove. These are required to pin as direct dependencies with Go modules.
	_ "golang.org/x/net/idna"
	_ "golang.org/x/text/transform"
	_ "github.com/grpc-ecosystem/grpc-gateway/utilities"
)

func InitModule(ctx context.Context, logger runtime.Logger, db *sql.DB, nk runtime.NakamaModule, initializer runtime.Initializer) error {
	_, err := agones.NewSDK()
	if err != nil {
		return err
	}
	return nil
}

```

I should note that I don’t know much about the Agones Go SDK so my code is just an example to check it all compiles and runs fine.

I can add more details if it’d help but let me know if this resolves the build issue with your code.

---

_[View the full topic](https://forum.heroiclabs.com/t/dependency-conflict-errors-when-using-agones-sdk-in-runtime-module/423)._
