Skip to content

saveTable() not working in 1.2.0 #5080

@maartenwijntjes

Description

@maartenwijntjes

Most appropriate sub-area of p5.js?

  • Accessibility (Web Accessibility)
    Build tools and processes
    Color
    Core/Environment/Rendering
    Data
    DOM
    Events
    Friendly error system
    Image
    IO (Input/Output)
    Localization
    Math
    Unit Testing
    Typography
    Utilities
    WebGL
    Other (specify if possible)

Details about the bug:

I found that saveTable() is not working anymore in 1.2.0. The easiest way to reproduce this is to run the code from https://p5js.org/reference/#/p5/saveTable in the editor.p5js.org. When you change the p5 version into 1.1.0 in the html file it does work.

let table;

function setup() {
table = new p5.Table();

table.addColumn('id');
table.addColumn('species');
table.addColumn('name');

let newRow = table.addRow();
newRow.setNum('id', table.getRowCount() - 1);
newRow.setString('species', 'Panthera leo');
newRow.setString('name', 'Lion');

// To save, un-comment next line then click 'run'
 saveTable(table, 'new.csv');
}

Activity

maartenwijntjes

maartenwijntjes commented on Mar 11, 2021

@maartenwijntjes
Author

Same happens in Chrome (and is also resolved when using 1.1.0), and error message is:

p5.js says: An error with message "table.rows[i].arr[j].includes is not a function" occured inside the p5js library when saveTable was called (on line 86 in about:srcdoc [about:srcdoc:86:2])

KarthikSundar2002

KarthikSundar2002 commented on Mar 11, 2021

@KarthikSundar2002

Can I give this bug a shot? It is my first time working in this codebase

limzykenneth

limzykenneth commented on Mar 11, 2021

@limzykenneth
Member

This seems to be fixed in 1.3.0 (just released). @maartenwijntjes Can you test with 1.3.0 can confirm if it is fixed?

maartenwijntjes

maartenwijntjes commented on Mar 11, 2021

@maartenwijntjes
Author

Yes worked! I did have to change it manually into 1.3.0 at the editor.p5js.org, do you have an idea when this will be standard? Or should I go over and ask at 'p5.js-web-editor'? Thanks anyway for the quick fix!

limzykenneth

limzykenneth commented on Mar 11, 2021

@limzykenneth
Member

I'm not as involved with the development of the web editor but you can head over to the web editor repository and see if they have a set policy around how and when they update the default p5.js version (maybe by searching existing issues first).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @maartenwijntjes@limzykenneth@KarthikSundar2002

        Issue actions

          saveTable() not working in 1.2.0 · Issue #5080 · processing/p5.js