[p5.js 2.0 Bug Report]: require('../../translations/dev')
breaks ESM usage in browser-based tools like Vite
#7822
Labels
Most appropriate sub-area of p5.js?
p5.js version
2.0.2
Web browser and version
Firefox 138.0.3
Operating system
Archlinux
Steps to reproduce this
Steps:
npm run dev
.Snippet:
Result:
Vite build fails immediately:
Cause:
The ESM build includes this CommonJS line:
This
require()
is invalid in ESM and unresolved in Vite/browser tools.Note:
Manually replacing this line with
let completeResources = {};
allows the build to proceed — but this is just a workaround, not a real fix.The text was updated successfully, but these errors were encountered: