Skip to content

Bug Report: Large File Conversion Failure #7

@woter1832

Description

@woter1832

Package Information

Environment

  • OS: Windows 11
  • Node.js: 24.5.0
  • Execution: Via MCP (Model Context Protocol) integration in Kiro IDE

Bug Description

The create_pdf_from_markdown_file tool fails silently when attempting to convert large markdown files. Small files (< 50 lines) convert successfully, but larger files (1300+ lines) fail without error messages.

Test Results

✅ Successful Test (Small File)

  • File: test-markdown2pdf.md
  • Size: ~20 lines
  • Content: Basic markdown with headings, lists, bold/italic text, code block
  • Result: Successfully created PDF at C:\Users\woter1832\test-output.pdf

❌ Failed Test (Large File)

  • File: Workshop-Minutes-2025-10-06-DETAILED.md
  • Size: 1363 lines
  • Content: Complex document with multiple sections, tables of contents, nested headings
  • Result: Tool execution failed with no error message

Steps to Reproduce

  1. Install the package version 2.1.3:

    npm install -g markdown2pdf-mcp@2.1.3
  2. Configure MCP server in Kiro IDE:

    {
      "markdown2pdf": {
        "command": "npx",
        "args": ["markdown2pdf-mcp@2.1.3"],
        "disabled": false
      }
    }
  3. Test with small file (works):

    create_pdf_from_markdown({
      markdown: "# Test\n\nSmall content",
      outputFilename: "test.pdf"
    })
  4. Test with large file (fails):

    create_pdf_from_markdown_file({
      markdownFilePath: "path/to/large-file.md",
      outputFilename: "output.pdf"
    })

Expected Behaviour

Large markdown files should convert to PDF successfully, or return a meaningful error message if there are size limitations.

Actual Behaviour

The tool fails silently with "Tool execution failed" and no additional error information. No PDF is generated.

Possible Causes

  1. Timeout: Large files may exceed processing timeout limits
  2. Memory: Insufficient memory allocation for large file processing
  3. Buffer size: Input buffer may have size restrictions
  4. Error handling: Errors during processing may not be properly caught and reported

Suggested Investigation

  1. Add timeout configuration options for large files
  2. Implement proper error handling and reporting
  3. Add file size validation with clear error messages
  4. Consider streaming or chunked processing for large files
  5. Add debug logging to identify where the process fails

Workaround

None currently available. Users must use alternative tools (e.g., pandoc directly) for large markdown files.

Additional Context

  • The Windows path handling issue reported in Bug Report: Windows Path Handling Issue #6 has been successfully fixed in version 2.1.3
  • Small files convert without any issues
  • The failure occurs with both relative and absolute file paths
  • No error logs are generated in the MCP server output

Impact

This limits the tool's usefulness for real-world documentation, which often exceeds 1000 lines. Users cannot convert comprehensive technical documents, meeting minutes, or detailed specifications.


Reported by: @woter1832
Issue created by AI: Sonnet 4.5 (Kiro)
Severity: High (tool unusable for large documents)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions