Frontmatter
| id | 5489 |
| title | Webpack creates wrong bundles (harmony) which can load & instanciate singletons multiple times |
| state | Closed |
| labels | bughelp wantedstale |
| assignees | [] |
| createdAt | Jun 26, 2024, 3:45 PM |
| updatedAt | Oct 10, 2024, 4:33 AM |
| githubUrl | https://github.com/neomjs/neo/issues/5489 |
| author | tobiu |
| commentsCount | 4 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Oct 10, 2024, 4:33 AM |
Webpack creates wrong bundles (harmony) which can load & instanciate singletons multiple times

steps to reproduce:
- clone the repo
- npm i
- npm run build threads => app => development (or alternatively npm run build-all)

i stepped more through the build logic and the new trouble-maker obviously is the LivePreview component.
it makes sense: we have a string, which can change in any possible way at run-time, which then gets parsed (replacing static with dynamic imports) and then converted into JS.
IF the previews were readOnly, we could probably monkey-patch it (magic comments to ignore our custom logic and telling build-tools exactly what to import instead)
otherwise, the LivePreview is limited to the dev mode.
This still does not justify though that Webpack sneaks in singletons more than once.
@github-actions - 2024-09-26T02:32:41Z
This issue is stale because it has been open for 90 days with no activity.
- 2024-09-26T02:32:42Z @github-actions added the
stalelabel
@github-actions - 2024-10-10T02:33:37Z
This issue was closed because it has been inactive for 14 days since being marked as stale.
- 2024-10-10T02:33:37Z @github-actions closed this issue
i did not see it before using our
LivePreviewwhich dynamically imports apps which can dynamically import other modules.sadly this is a "game over" for our dist/development & dist/production env.
imho we do not need harmony these days anyway => browsers and node are capable of using real JS modules.
@sokra