Skip to content

Add import and export as ESM Modules #3304

Open
@ejgutierrez74

Description

Increasing Access

I have many problems just importing a class from other file in my sketch. The problem is that p5.js Web Editor doesnt work like all the JS frameworks or code. Also it doesnt show any messages to solve this, only doesnt work and leave the canvas in blank

Feature request details

Use import/export like ESM estandard modules.
You can see an example of code that should work in p5.js Web Editor ( it works fine in Webstorm or VS Code), but doent work. You have to delete the export and import keywords to work properly.
Would be nice that p5.js Web Editor would at least show a messge that import/export doesnt work or suggest to change the code.

https://editor.p5js.org/egutie9/sketches/O_xfapq72

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions