Frontmatter
| id | 3173 |
| title | app worker build, workspace scope, windows |
| state | Closed |
| labels | bugwindowsstale |
| assignees | tobiu |
| createdAt | Jun 21, 2022, 12:59 PM |
| updatedAt | Oct 9, 2026, 10:25 PM |
| githubUrl | https://github.com/neomjs/neo/issues/3173 |
| author | tobiu |
| commentsCount | 4 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| contentTrust | |
| projected | |
| quarantined | 0 |
| signals | [] |
| blockedBy | [] |
| blocking | [] |
| closedAt | Sep 15, 2024, 4:35 AM |
app worker build, workspace scope, windows
tobiu assigned to @tobiu on Jun 21, 2022, 12:59 PM

tobiu
Jun 21, 2022, 3:31 PM
hotfix candidate: https://github.com/neomjs/neo/releases/tag/4.0.49
Right now, the windows builds are running fine inside the framework scope, but they fail silently when running inside a neo workspace (
npx neo-app).The problem seems to be the combination of our app worker entry-point:
importApp(path) { if (path.endsWith('.mjs')) { path = path.slice(0, -4); } return import( /* webpackInclude: /[\\\/]app.mjs$/ */ /* webpackExclude: /[\\\/]node_modules/ */ /* webpackMode: "lazy" */ `../../${path}.mjs` ); }https://github.com/neomjs/neo/blob/dev/src/worker/App.mjs#L98
in combination with the ContextReplacementPlugin (webpack): https://webpack.js.org/plugins/context-replacement-plugin/
The relevant code is this one:
plugins: [ new webpack.ContextReplacementPlugin(/.*/, context => { if (!insideNeo && context.context.includes('/src/worker')) { context.request = '../../' + context.request; } }), ...plugins ]https://github.com/neomjs/neo/blob/dev/buildScripts/webpack/production/webpack.config.appworker.mjs#L135
Obviously we need to check for
\\src\\workerand adjust context.request using thepathnodejs API.However, when adding testing logs, I saw that our one app worker based dynamic import to fetch potential app entry-points will get called twice inside the ContextReplacementPlugin. Even the same instance. so, instead of going up for another 2 folder levels, it will end up going up for 4 levels instead.
This might be a topic for @sokra.
As a workaround, we could adjust the code in a way, that
context.requestwill only get modified once.@Dinkh, @davhm: I could use your help on this one, since I no longer have Windows running inside a VM on my machine(s).