Skip to content

SandpackConsole output is confusing in some scenarios #71

@with-heart

Description

@with-heart

In the "Last" section of Magic Motion, the output of the console is confusing because SandpackConsole appears to place each logged item on its own line, even when items are logged in the same call.

For example, after toggling the position of the box a few times, the console.log(box.x, box.y) call in line 8 of the sample results in this output:

image

I have no idea which numbers correspond and the only way to make that more clear is to clear the console, go back to the preview, toggle it once, and then return to the console to see the single-position output. Rinse and repeat.

I'm not sure if this is a built-in limitation of SandpackConsole but an easy fix is to log values that belong together as an object. Using console.log({x: box.x, y: box.y}):

image

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