encore icon indicating copy to clipboard operation
encore copied to clipboard

Unable to generate OpenAPI schema due to "Internal Compiler Error"

Open L8D opened this issue 11 months ago • 2 comments

Hello. I tried to generate an OpenAPI schema for the first time. This is what happened:

phnx% encore gen client phoenix-api-kwr2 --lang=openapi --output=./openapi.json

error: 
── Internal compiler error ────────────────────────────────────────────────────────────────[E0001]──

An unhandled panic occurred in the Encore compiler: runtime error: invalid memory address or nil
pointer dereference

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]
├─▶ clientgen.Client.func1              encr.dev/pkg/clientgen/client.go:65
├─▶ openapi.(*Generator).Generate.func1 encr.dev/pkg/clientgen/openapi/openapi.go:54
├─▶ json.(*encodeState).marshal.func1   encoding/json/encode.go:294
├─▶ json.(*encodeState).marshal.func1   encoding/json/encode.go:294
├─▶ json.(*encodeState).marshal.func1   encoding/json/encode.go:294
├─▶ openapi3.SchemaRef.MarshalJSON      github.com/getkin/[email protected]/openapi3/refs.go:568
╰─[... remaining frames omitted ...]

other details:

this is a typescript api this has not been deployed to Encore Cloud yet

L8D avatar Apr 12 '25 22:04 L8D

For visibility, this issue is being discussed on Discord: https://discord.com/channels/814482502336905216/1360749478390530230/1360749478390530230

marcuskohlberg avatar Apr 14 '25 13:04 marcuskohlberg

Seeing same issue

danhawkins avatar Apr 23 '25 12:04 danhawkins