类型错误无法设置未定义的 属性 '_minWidth' - pdfmake,Angular 2

Type Error Cannot set property '_minWidth' of undefined - pdfmake, Angular 2

我正在尝试为我的 table 添加宽度,但由于某种原因我收到以下错误:

Component.html:187 ERROR TypeError: Cannot set property '_minWidth' of undefined  at DocMeasure.measureTable (pdfmake.js:4487)
at pdfmake.js:4012
at StyleContextStack.auto (pdfmake.js:6069)
at DocMeasure.measureNode (pdfmake.js:3999)
at DocMeasure.measureVerticalContainer (pdfmake.js:4216)
at pdfmake.js:4006
at StyleContextStack.auto (pdfmake.js:6069)
at DocMeasure.measureNode (pdfmake.js:3999)
at DocMeasure.measureDocument (pdfmake.js:3992)
at LayoutBuilder.tryLayoutDocument (pdfmake.js:3120)
at LayoutBuilder.layoutDocument (pdfmake.js:3107)
at PdfPrinter.createPdfKitDocument (pdfmake.js:2383)
at Document._createDoc (pdfmake.js:105)
at Document.getBuffer (pdfmake.js:243)
at Document.getBlob (pdfmake.js:233)

问题行

widths: ['auto', 'auto', 'auto', 'auto'],

我的文档定义

var docDefinition = {
        content: [
            {text: 'Section A: Facilities and Ambience', style: 'sectionStyling'},
            {
                style: 'tableExample',
                table: {
                    widths: ['auto', 'auto', 'auto', 'auto'],
                    body: [
                        ['col1', 'col2', 'col3', 'col4', 'col5'],
                        ['some text', '1', '1', '100%', '-'],
                        ['some text', '1', '1', '100%', '-'],
                        ['some text', '1', '1', '100%', '-'],
                        ['some text', '1', '1', '100%', '-'],
                        ['some text', '1', '1', '100%', '-'],
                        ['some text', '1', '1', '100%', '-'],
                        ['some text', '1', '1', '100%', '-'],
                        ['some text', '1', '1', '100%', '-']
                    ]
                }
            }
        ],
        background: function () {
            return [
                {
                    image: 'watermark',
                    width: 200,
                    alignment : 'center',
                    margin: [0, 325, 0, 0]
                }
            ];
        },
        images: {
            watermark: 'data:image/base64....'
        },
        styles: {
            sectionStyling: {
                fontSize: 18,
                color: 'blue',
                bold: true,
                alignment: 'right',
                margin: [0, 190, 0, 80]
            },
            subheader: {
                fontSize: 14
            },
            superMargin: {
                margin: [20, 0, 40, 0],
                fontSize: 15
            }
        },
        defaultStyle: {
            alignment: 'justify'
        }
    };

我尝试了(以下工作的none):

widths: ['auto', 'auto', 'auto', 'auto'],
widths: ['auto', 'auto', 'auto'],
widths: [100, '*', 200, '*'],


It works if I just remove the widths line.

您有五列,但只设置了四种宽度。尝试为所有这些设置宽度:

widths: ['auto', 'auto', 'auto', 'auto', 'auto'];