Offline plugin compilation problem

Hi,

My gateway version is 5.2.2. I tried to build a custom Go plugin and has a CI/CD workflow. Due to some reasons, my CI/CD server can not access the internet freely. So, I can not follow the build flow in the documentation where I should do the following stuff in the CI/CD server:
go get github.com/TykTechnologies/tyk@af872f97490afc87137bfc5a340e60df85e2e01f
go mod tidy

Instead, I do package vendoring (hence no need to download packages in the CI/CD server), include the vendor folder to the source code and change the entrypoint build.sh in the tyk-plugin-compiler Docker container in such a way that the build process is using -mod=vendor. The build step is successful without an internet access, but somehow when the gateway loads the plugin, I got this error:

Could not load Go-plugin" error="plugin.Open("/opt/tyk-hybrid/middleware/poc-plugin_v5.2.2_linux_amd64.so"): plugin was built with a different version of package github.com/TykTechnologies/tyk/internal/reflect (previous failure).

Any idea why this happened? What should I do?

Thanks in advance.

We can observe a similar ticket opened in our commercial support channel. We are working on trying to find a solution or workaround internally.

We assume this is related to that, if not then please let us know.