Skip to content
← Back to activity

Public problem

Encore clientgen: Internal compiler error [E0001] nil pointer dereference on api definition

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

Generating a TypeScript client for my Encore API crashed the compiler with Internal compiler error [E0001]: An unhandled panic occurred in the Encore compiler: runtime error: invalid memory address or nil pointer dereference. A minimal repro showed it only happens when you use an inline type in an api definition, that inline type references a named type, AND the service folder name doesnt match the service name. The maintainer confirmed the fix version in January 2026.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

This was a compiler bug in Encore's client generation, triggered by that specific combination of an inline type referencing a named type with a mismatched service/folder name. Its fixed in encore v1.53.7, so run encore version update and regenerate. The workaround if youre stuck on an older version is to not use the inline type: define the full request type as a named type before the api definition, which one reporter confirmed avoids the panic. Source: https://github.com/encoredev/encore/issues/1711

Source: https://github.com/encoredev/encore/issues/1711