Skip to content

Add import and export as ESM Modules #3304

@ejgutierrez74

Description

@ejgutierrez74

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

Activity

welcome

welcome commented on Dec 21, 2024

@welcome

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.

ejgutierrez74

ejgutierrez74 commented on Feb 2, 2025

@ejgutierrez74
Author

It doesnt work:

Image

takshittt

takshittt commented on Mar 2, 2025

@takshittt
Contributor

Are you working on this issue or it needs discussion?

ejgutierrez74

ejgutierrez74 commented on Mar 2, 2025

@ejgutierrez74
Author

?? Its a bug or missing feature.... im not a developer i cant work on it

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

    Feature RequestProposal for adding a new functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @ejgutierrez74@takshittt

      Issue actions

        Add import and export as ESM Modules · Issue #3304 · processing/p5.js-web-editor