Troubleshooting
Common issues and solutions when using InkGen.
Build Errors
“Profile not found” Error
Problem: InkGen reports that a profile or resource cannot be found.
Solution:
- Check that the profile file exists and is in the input directory
- Verify the spelling of the profile name
- Ensure all imports are correct:
import { Profile } from ... - Check FHIR version compatibility
“Invalid cardinality” Error
Problem: InkGen rejects the cardinality specification.
Solution:
- Use correct format:
min..max - Examples:
0..1,1..*,0..* - Ensure min ≤ max
Memory Issues
Problem: InkGen runs out of memory on large profile sets.
Solution:
- Increase Node.js heap:
NODE_OPTIONS="--max-old-space-size=4096" npm run build - Split profiles into smaller batches
- Use incremental generation:
--incremental
TypeScript Generation Issues
Type Not Found
Problem: Generated code references undefined types.
Solution:
- Ensure FHIR type definitions are installed
- Check
tsconfig.jsonincludes:@types/fhir - Verify imports in generated files
Validation Function Errors
Problem: Validation functions fail at runtime.
Solution:
- Update FHIR libraries to latest version
- Check that input data matches profile constraints
- Enable debug logging:
INKGEN_DEBUG=true
Performance Issues
Slow Generation
Problem: Code generation takes too long.
Solution:
- Enable parallelization:
"parallel": truein config - Use incremental builds
- Profile the build:
--profile - Check disk I/O performance
Getting Help
- Check the Documentation
- Review Examples
- Open an issue on GitHub
- Check the Roadmap for planned features
Common Patterns
See Advanced Topics for solutions to common problems.