You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression in v7.8.1: index.html no longer listed in Webpack assets #3949
I agree to follow the code of conduct that this project uses.
I have searched the issue tracker for a bug that matches the one I want to file, without success.
Forge version
7.8.1
Electron version
36.4.0
Operating system
Windows 10 (19045.5854)
Last known working Forge version
7.8.0
Expected behavior
Webpack plugins see my renderer's index.html as an asset when calling compilation.getAssets().
Actual behavior
Starting with Forge v7.8.1, Webpack plugins do not see my renderer's index.html as an asset when calling compilation.getAssets() on Windows. (It works fine on macOS.)
Thanks for the detailed repro, @nikwen. I tried to reproduce this on Linux using your forge-jiti-bug setup — stock webpack-typescript template on Forge 7.8.1, config kept as forge.config.ts so the jiti loader from #3907 is in play (webpack 5.108.3, jiti 2.7.0) — and index.html is emitted normally. compilation.getAssets() at PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER includes main_window/index.html, and the file is written to .webpack/renderer/main_window/.
Looking at the mechanism on Linux: there's a single shared webpack/Compilation in require.cache, Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER is 3000 (not undefined), and the Compilation the jiti-loaded plugin imports is identical (===) to the one the build uses. typeof Compilation === "function" does hold under the jiti path here too, but the static stage constant is still intact — so that part alone doesn't seem sufficient to cause the drop.
Since it looks Windows-specific and I can't trigger it on Linux, could you reconfirm it still reproduces on your Windows setup with current versions? If it does, it'd help a lot to see, from inside your plugin on Windows:
the value and typeof of Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER, and
whether there's more than one webpack/lib/Compilation.js entry in require.cache (i.e. more than one loaded Compilation class).
That would confirm whether this is jiti loading a second webpack copy via Windows path casing, which is our leading theory.
Activity
nikwen commentedon Jun 10, 2025
I think this is the root cause:
On v7.8.0,
Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFERis3000.On v7.8.1,
Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFERisundefined.If I set
stage: undefinedon v7.8.0, I get the same behavior there.v7.8.1 imports
Compilationas afunctionwhereas v7.8.0 importsCompilationas an object.claude commentedon Jul 1, 2026
Thanks for the detailed repro, @nikwen. I tried to reproduce this on Linux using your
forge-jiti-bugsetup — stockwebpack-typescripttemplate on Forge 7.8.1, config kept asforge.config.tsso the jiti loader from #3907 is in play (webpack 5.108.3, jiti 2.7.0) — andindex.htmlis emitted normally.compilation.getAssets()atPROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFERincludesmain_window/index.html, and the file is written to.webpack/renderer/main_window/.Looking at the mechanism on Linux: there's a single shared
webpack/Compilationinrequire.cache,Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFERis3000(notundefined), and theCompilationthe jiti-loaded plugin imports is identical (===) to the one the build uses.typeof Compilation === "function"does hold under the jiti path here too, but the static stage constant is still intact — so that part alone doesn't seem sufficient to cause the drop.Since it looks Windows-specific and I can't trigger it on Linux, could you reconfirm it still reproduces on your Windows setup with current versions? If it does, it'd help a lot to see, from inside your plugin on Windows:
typeofofCompilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER, andwebpack/lib/Compilation.jsentry inrequire.cache(i.e. more than one loadedCompilationclass).That would confirm whether this is jiti loading a second webpack copy via Windows path casing, which is our leading theory.
nikwen commentedon Jul 1, 2026
Still repros, of course, and it is Windows-only as mentioned in the description.
claude commentedon Jul 1, 2026
Working with Samuel Attard
hello there this is a test
claude commentedon Jul 1, 2026
Working with @MarshallOfSound
one more test