dagger/dagger · error
unknown built-in sdk
Error message
unknown built-in sdk
What it means
errUnknownBuiltinSDK is a sentinel meaning the requested SDK name is not one of the engine's built-in SDKs (go, dang, python, typescript, java, php, elixir). It is used for control flow: SDKForModule treats it as 'not builtin, try external resolution', so seeing it alone is benign — it only surfaces as a failure when external loading also fails and the final `invalid SDK` error is raised. It is returned by namedSDK/parseSDKName when the name doesn't match a builtin.
Solutions
- Fix the sdk value in dagger.json to an exact builtin name: go, python, typescript, dang, java, php, or elixir.
- If you intended a custom SDK, use a valid module ref (git URL like github.com/dagger/dagger/sdk/elixir@main, or a local path like ./my-sdk).
- Run `dagger develop` after fixing dagger.json so the config is revalidated.
- Check the error output of SDKForModule, which prints the full list of available SDKs and both failure causes.
Example fix
// before: dagger.json
{ "name": "my-module", "sdk": "golang" }
// after
{ "name": "my-module", "sdk": "go" } Defensive patterns
Strategy: validation
Validate before calling
const BUILTINS = ['go','dang','python','typescript','java','php','elixir']
const cfg = JSON.parse(require('fs').readFileSync('dagger.json','utf8'))
const name = (cfg.sdk || '').split('@')[0]
const isBuiltin = BUILTINS.includes(name)
const isRef = /^(github\.com\/[^\s]+|\.\.?\/)/.test(cfg.sdk || '')
if (!isBuiltin && !isRef) throw new Error(`sdk "${cfg.sdk}" is neither builtin nor a module ref`) Type guard
function isBuiltinSdkName(s) {
return ['go','dang','python','typescript','java','php','elixir'].includes(String(s).split('@')[0])
} Prevention
- Use exact builtin names: go, dang, python, typescript, java, php, elixir (not 'golang', 'ts', 'js')
- For custom SDKs use a full git ref or local path that resolves as a module
- Run `dagger develop` to validate config changes early
- List valid SDKs from the engine error output when unsure
When it happens
Trigger: SDKForModule called with sdk.Source that is neither a builtin name (e.g. "ruby", "golang" misspelled) nor a resolvable git/local SDK module ref, so both namedSDK (returns errUnknownBuiltinSDK) and externalSDKForModule fail.
Common situations: Typo in the sdk field of dagger.json (e.g. "sdk": "golang" instead of "go"); using an SDK name for a language Dagger doesn't bundle; trying a custom SDK ref that doesn't resolve as a module path.
Related errors
- invalid SDK
- no sdk ref provided
- build asModule args for
- cannot unmarshal into nil SDK
- cannot unmarshal into nil %T
AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05).
Data as JSON: /api/errors/278fc545dd52756c.
Report an issue: GitHub.
Appendix: source
Thrown at core/sdk/loader.go:23
"errors"
"fmt"
"os"
"slices"
"strings"
"github.com/dagger/dagger/core"
"github.com/dagger/dagger/core/sdk/sdkmeta"
"github.com/dagger/dagger/dagql"
"github.com/dagger/dagger/engine"
"github.com/dagger/dagger/engine/distconsts"
iversion "github.com/dagger/dagger/internal/version"
telemetry "github.com/dagger/otel-go"
"github.com/opencontainers/go-digest"
)
var (
errMissingSDKRef = errors.New("no sdk ref provided")
errUnknownBuiltinSDK = errors.New("unknown built-in sdk")
)
type Loader struct{}
func NewLoader() *Loader {
return &Loader{}
}
func init() {
core.SetModuleSourceSDKLoader(func(ctx context.Context, query *core.Query, sdkCfg *core.SDKConfig, src *core.ModuleSource) (core.SDK, error) {
return NewLoader().SDKForModule(ctx, query, sdkCfg, src)
})
}
// SDKForModule loads an SDK module based on the given SDK configuration.
//
// If it's a builtin SDK, it will load it from the engine container.
// Otherwise, it will load it from the given source either from a URLView on GitHub (pinned to 82ba2681db)