Skip to content

Uncaught TypeError: row.Category is undefined #2

Description

@hideosnes

Strangely enough, I get the error message with my own code and with the c&p code from your example. I'm running it in VS-Code with the Live Server extension. The data console-log fires correctly, but I get "Uncaught TypeError: row.Category is undefined" in Firefox. Any ideas what might be the cause? (Edit: In Chromium there's no error message at all and it doesn't render any contents of the G-Sheet.)

`

<script src="https://cdn.jsdelivr.net/gh/pierreavn/websheetjs/dist/websheet.min.js" type="text/javascript"></script>

<script>

    websheet('stuff', {
    url: 'some url',
    sheet: 'Stuff',
    // caching: true,
    onLoaded: data => {
        if (data) {
            console.log('data =', data);
        } else {
            console.error('Error loading data from URL');
            // add error handling
        }
    },
    aliases: {
            // Aliases for each category
            'foo?': row => row['Category'].value === 'oof',   // error message indicates this line
            'bar?': row => row['Category'].value === 'rab',
            'foobar?': row => row['Category'].value === 'raboof',
        },
    })
</script> <!-- </> Websheets -->`

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