Troubleshooting

Common issues and solutions when using DocBox

This guide covers common issues you might encounter when using DocBox and their solutions.

🚨 Common Errors

"Output directory does not exist"

Error Message:

The output directory [/path/to/docs] does not exist

Cause: The specified output directory doesn't exist on the filesystem.

Solution:

// Option 1: Create the directory first
directoryCreate( expandPath( "/docs" ), true );

// Option 2: Use an existing directory
new docbox.DocBox()
    .addStrategy( "HTML", {
        outputDir: expandPath( "/existing/path" )
    } )
    .generate( source: "/src", mapping: "app" );

Missing Source Mappings (CLI)

Error Message:

Cause: The BoxLang CLI command wasn't provided with source directory information.

Solution: Ensure you provide either:

  • --source and --mapping together

  • One or more --mappings:<name>=<path> options

  • JSON array via --source

"Cannot read properties of undefined (reading 'toLowerCase')"

Cause: JavaScript error in HTML templates when filtering methods with missing properties.

Solution: This was fixed in DocBox 5.0. Update to the latest version:

Component Not Found

Error Message:

Cause: The mapping specified doesn't match the actual package structure.

Solution: Ensure your mapping matches your component path structure:

Exclusion Pattern Not Working

Problem: Files are still being documented despite exclusion pattern.

Cause: Exclusion patterns are applied to relative file paths, not absolute paths.

Solution: Use patterns that match the relative path structure:

πŸ” Metadata Issues

Empty Documentation Pages

Problem: Generated docs show components but no methods/properties.

Cause: Components lack JavaDoc comments or metadata.

Solution: Add proper documentation to your components:

Generic Types Not Showing

Problem: Generic type annotations like Array<User> not appearing in docs.

Cause: Using standard @returntype instead of @doc_generic.

Solution: Use the @doc_generic annotation:

Implements Not Detected

Problem: Interface implementations not showing in documentation.

Cause: Engine-specific metadata format differences.

Solution: DocBox 5.0+ handles both formats automatically. If using older versions, update:

🎨 HTML/UI Issues

Dark Mode Not Persisting

Problem: Dark mode preference resets on page reload.

Cause: Browser localStorage might be disabled or cleared.

Solution:

  1. Check browser console for localStorage errors

  2. Enable localStorage in browser settings

  3. Clear site data and try again

Search Not Working

Problem: Method search doesn't filter results.

Cause: JavaScript not loading or Alpine.js initialization issue.

Solution:

  1. Check browser console for errors

  2. Ensure you're using a modern browser (Chrome, Firefox, Edge, Safari)

  3. Clear browser cache and reload

  4. Check network tab for failed asset loads

Theme Not Loading

Problem: Documentation appears unstyled or broken.

Cause: Asset paths incorrect or theme not specified properly.

Solution:

πŸ› οΈ Build Issues

CLI Command Not Found

Error Message:

Cause: bx-docbox module not installed.

Solution:

Memory Issues with Large Codebases

Problem: DocBox runs out of memory when processing large projects.

Solution:

  1. Increase JVM heap size:

  1. Process in smaller chunks:

  1. Use more aggressive exclusion patterns:

Build Hangs or Takes Too Long

Problem: Documentation generation appears to hang.

Cause: Processing too many files or infinite recursion in inheritance.

Solution:

  1. Add verbose logging to see progress

  2. Check for circular dependencies in your code

  3. Exclude unnecessary directories

  4. Run in smaller batches

🦀 BoxLang-Specific Issues

BoxLang Module Not Loading

Problem: Module loads but CLI command errors out.

Cause: Module registration issue or conflicts.

Solution:

Metadata Format Differences

Problem: Documentation differs between CFML and BoxLang engines.

Cause: BoxLang uses different metadata structure for some properties.

Solution: DocBox 5.0+ automatically handles both formats. If you're on an older version:

πŸ“Š Strategy-Specific Issues

JSON Output Empty

Problem: JSON files generated but contain no data.

Cause: Source directory or mapping incorrect.

Solution: Verify your paths and mappings:

XMI/UML Strategy Fails

Problem: XMI strategy throws errors.

Cause: Missing or invalid output file path.

Solution:

πŸ”§ Debug Tips

Enable Verbose Logging

Add debugging output to your generation script:

Check Component Metadata

Verify your component metadata is readable:

Validate Output Directory Permissions

Ensure DocBox can write to the output directory:

πŸ“ž Getting Help

If you're still experiencing issues:

  1. Check Documentation: docbox.ortusbooks.com

  2. Search Issues: Jira Issue Tracker

  3. Community Forums: Ortus Community

  4. CFML Slack: #box-products channel at cfml-slack.herokuapp.com

  5. Professional Support: Ortus Solutions

πŸ“ Reporting Bugs

When reporting issues, please include:

  • DocBox version (box info docbox or boxlang module:docbox --version)

  • CFML engine and version

  • Operating system

  • Complete error message and stack trace

  • Minimal code example to reproduce

  • Expected vs actual behavior

Last updated

Was this helpful?