Repository navigation
Labels
Description
Pre-flight checklist
- I have read the contribution documentation for this project.
- 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.6.1 aswell as 7.7.0
Electron version
34.0.0
Operating system
Arch Linux
Last known working Forge version
7.7.0 but with Node 23.5
Expected behavior
The command npm run package should work on node-versions greater than 23.5 as "good" as on version 23.5 and less.
Actual behavior
On node 23.6, 23.7 and 23.8:
pm run package
> [email protected] package
> electron-forge package
✔ Checking your system
✖ Preparing to package application
›
1. Cannot find module '/tmp/test/my-app/webpack.main.config' imported from /tmp/test/my-app/forge.config.ts
2. Cannot find module '/tmp/test/my-app/webpack.main.config' imported from /tmp/test/my-app/forge.config.ts
◼ Running packaging hooks
◼ Packaging application
◼ Running postPackage hook
(node:7471) ExperimentalWarning: Type Stripping is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Failed to load: /tmp/test/my-app/forge.config.ts
(node:7471) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///tmp/test/my-app/forge.config.ts is not specified and it doesn't parse as CommonJS.
Reparsing as ES module because module syntax was detected. This incurs a performance overhead.
To eliminate this warning, add "type": "module" to /tmp/test/my-app/package.json.
An unhandled rejection has occurred inside Forge:
Error [ERR_MODULE_NOT_FOUND]:
1. Cannot find module '/tmp/test/my-app/webpack.main.config' imported from /tmp/test/my-app/forge.config.ts
2. Cannot find module '/tmp/test/my-app/webpack.main.config' imported from /tmp/test/my-app/forge.config.ts
at finalizeResolution (node:internal/modules/esm/resolve:275:11)
at moduleResolve (node:internal/modules/esm/resolve:860:10)
at defaultResolve (node:internal/modules/esm/resolve:984:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:719:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:643:25)
at #resolveAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:678:38)
at ModuleLoader.resolveSync (node:internal/modules/esm/loader:701:52)
at #cachedResolveSync (node:internal/modules/esm/loader:662:25)
at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:390:50)
at new ModuleJobSync (node:internal/modules/esm/module_job:342:34)
at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:363:11)
at loadESMFromCJS (node:internal/modules/cjs/loader:1565:24)
at Module._compile (node:internal/modules/cjs/loader:1716:5)
at Object.loadTS [as .ts] (node:internal/modules/cjs/loader:1826:10)
at Module.load (node:internal/modules/cjs/loader:1469:32)
at Function._load (node:internal/modules/cjs/loader:1286:12)
Steps to reproduce
- Generate empty project from template:
npx create-electron-app@latest my-app --template=webpack-typescript - Change into the directory
cd my-app - Run
npm run package
Additional information
When I switch with nvm to node 23.5, it works again
Activity
erickzhao commentedon Mar 10, 2025
Hey @SebastianRzk, thanks for raising this issue. It seems like the way we import features is incompatible with the default behaviour of the
--experimental-strip-typesfeature, which was unflagged in v23.6.0 of Node.js (https://nodejs.org/en/blog/release/v23.6.0).I verified this by turning the feature off after running your repro steps:
[-]Does not build webpack-typescript when Node-version 23.6, 23.7 and 23.8 [ERR_MODULE_NOT_FOUND][/-][+]TypeScript Forge configuration fails to load for Node >=23.6[/+]mohamedrhoulam commentedon Mar 19, 2025
hello @erickzhao, for the moment is there any other workaround besides running
NODE_OPTIONS="--no-experimental-strip-types" npm run starterickzhao commentedon Mar 19, 2025
@mohamedrhoulam downgrading your Node.js version would work as well :)
pedro-w commentedon Mar 26, 2025
Just to add, for Windows users, the same bug occurs and the work-around is nearly the same
KKghub commentedon May 2, 2025
This still does not work on
v7.8.0(Mar 25), I believe the fix should be available in the next version bump which has not been released yet, May I know if it will be released soon?erickzhao commentedon May 2, 2025
Oops, I went on vacation like a week after getting that PR landed. I'm back now, though, so we'll look to get a new release out soon!
Crazh3 commentedon May 9, 2025
Do you have any plan to release the new version? The flowers I've been waiting for have all withered