Frontmatter
| id | 7783 |
| title | Dynamically import fs/promises in Store.mjs for Node.js compatibility |
| state | Closed |
| labels | enhancementai |
| assignees | tobiu |
| createdAt | Nov 17, 2025, 7:56 PM |
| updatedAt | Nov 17, 2025, 7:57 PM |
| githubUrl | https://github.com/neomjs/neo/issues/7783 |
| author | tobiu |
| commentsCount | 0 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Nov 17, 2025, 7:57 PM |
The
src/data/Store.mjscurrently attempts to usefs.readFilefor non-browser environments (like Node.js) within itsloadmethod. However, thefs/promisesmodule is conditionally imported usingglobalThis.process?.release. To prevent issues in browser environments wherefs/promisesis not available, the import needs to be dynamic.This change will ensure that
Store.mjscan be used seamlessly in web workers (browser environment) and Node.js, by only attempting to load thefs/promisesmodule when it's actually needed and available.Proposed Change: Modify the
loadmethod insrc/data/Store.mjsto use a dynamicimport('fs/promises')whenglobalThis.process?.releaseis true.