-
Notifications
You must be signed in to change notification settings - Fork 553
Open
Description
The error output:
❯ encore test ./...
── Internal compiler error ────────────────────────────────────────────────────────────────[E0001]──
An unhandled panic occurred in the Encore compiler: unknown builtin type Error
This is a bug in Encore and should not have occurred. Please report this issue to the Encore team
either on Github at https://github.com/encoredev/encore/issues/new and include this error.
╭─[Stack Trace]
├─▶ v2builder.BuilderImpl.Parse.func1.1 encr.dev/v2/v2builder/v2builder.go:51
├─▶ legacymeta.(*builder).builtinType encr.dev/v2/app/legacymeta/schema.go:61
├─▶ legacymeta.(*builder).schemaType encr.dev/v2/app/legacymeta/schema.go:72
├─▶ legacymeta.(*builder).schemaType encr.dev/v2/app/legacymeta/schema.go:130
├─▶ legacymeta.(*builder).structField encr.dev/v2/app/legacymeta/schema.go:163
├─▶ legacymeta.(*builder).schemaType encr.dev/v2/app/legacymeta/schema.go:92
╰─[... remaining frames omitted ...]
Versions:
❯ encore version
encore version v1.52.3
❯ go version
go version go1.25.1 darwin/arm64
Environment:
MacOS Sequoia 15.6.1 (Apple M4)
Details
I was able to find the code change that caused this on our end:
type Redacted struct {
Error *error `json:"error,omitempty"`
(more stuff here)
}
type RedactedCollection struct {
Results []Redacted
}
RedactedCollection is a return type for a private encore endpoint. Changing the error pointer to a string pointer bypasses the error.
Steps to reproduce:
- Create a private encore endpoint that returns a struct with a member representing an array of structs, which have a member that is a pointer to an error. Example using the structs represented above (roughly, sorry about all the redaction):
//encore:api private
func (n *RedactedServiceName) RedactedEndpointName(ctx context.Context, req RedactedResquest) (*RedactedCollection, error) { ... }- Add a test that invokes this private endpoint.
- Observe the compiler error.
Metadata
Metadata
Assignees
Labels
No labels