encoredev / encore

Development Platform for building robust type-safe distributed systems with declarative infrastructure

Home Page:https://encore.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error running encore app

a0v0 opened this issue · comments

commented

I am getting this when running encore run:

 ✔ Building Encore application graph... Done!
  ✔ Analyzing service topology... Done!
  ✔ Creating PostgreSQL database cluster... Done!
  ✔ Fetching application secrets... Done!
  ⠦ Generating boilerplate code... 
  ❌ Compiling application source code... Failed: Error
  ⠂ Running database migrations... 

── Error ────────────────────────────────────────────────────────────────────────────────────────────────────────────────[E0003]──

compilation failure: # encore.dev/appruntime/shared/health
/home/gitpod/.encore/runtime/appruntime/shared/health/health.go:107:30: type func(a CheckResult, b CheckResult) bool of func(a, b
CheckResult) bool {…} does not match inferred type func(a CheckResult, b CheckResult) int for func(a E, b E) int

╭─[Stack Trace]
├─▶ build.(*builder).buildMain.func1    /home/runner/work/encore/encore/encr.dev/v2/compiler/build/build.go:281
├─▶ etrace.Sync0                        /home/runner/work/encore/encore/encr.dev/internal/etrace/etrace.go:10
├─▶ build.(*builder).buildMain          /home/runner/work/encore/encore/encr.dev/v2/compiler/build/build.go:209
├─▶ build.(*builder).Build              /home/runner/work/encore/encore/encr.dev/v2/compiler/build/build.go:120
├─▶ build.Build                         /home/runner/work/encore/encore/encr.dev/v2/compiler/build/build.go:64
├─▶ v2builder.BuilderImpl.Compile.func1 /home/runner/work/encore/encore/encr.dev/v2/v2builder/v2builder.go:154
╰─[... remaining frames omitted ...]

encore version: v1.23.3
go version: v1.21.0

Thanks for the report. It looks like golang.org/x/exp/slices changed the signature of slices.SortFunc to accept functions that return an int instead of a bool`. See https://pkg.go.dev/golang.org/x/exp@v0.0.0-20230713183714-613f0c0eb8a1/slices#SortFunc versus https://pkg.go.dev/golang.org/x/exp@v0.0.0-20230809094429-853ea248256d/slices#SortFunc.

We can upgrade the runtime to the latest version of golang.org/x/exp but if you want to fix the issue on your side I would suggest downgrading golang.org/x/exp with go get golang.org/x/exp@v0.0.0-20230713183714-613f0c0eb8a1.