PKU426: Config Type Not Found
Error Message
[PKU426] Could not find Config type in typesLookup. Make sure you have a Config interface extending CoreConfig in your codebase.
What Went Wrong
Pikku couldn't find a Config interface in your TypeScript codebase. Pikku requires a Config type to understand your application's configuration structure.
How to Fix
Create a Config interface that extends CoreConfig:
// src/config.ts or src/types.ts
import { CoreConfig } from '@pikku/core'
export interface Config extends CoreConfig {
// Add your custom config properties
apiKey: string
databaseUrl: string
environment: 'development' | 'production'
}
Then export it in your services setup:
// src/services.ts
import { CreateConfig } from '@pikku/core'
import type { Config } from './config'
export const createConfig: CreateConfig<Config> = async () => {
return {
apiKey: process.env.API_KEY!,
databaseUrl: process.env.DATABASE_URL!,
environment: (process.env.NODE_ENV as any) || 'development',
}
}
Minimal Example
If you don't need custom config, you can use an empty interface:
import { CoreConfig } from '@pikku/core'
export interface Config extends CoreConfig {
// No custom properties needed
}
Common Mistakes
- Forgetting to extend
CoreConfig - Naming the interface
AppConfigorSettingsinstead ofConfig - Not exporting the Config type
- Placing the Config type in a file that's not scanned by the CLI
Where to Place Config
The Config interface should be in one of your srcDirectories specified in pikku.config.json:
{
"srcDirectories": ["src"],
"outDir": ".pikku"
}