Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not build webpack-typescript when Node-version 23.6, 23.7 and 23.8 [ERR_MODULE_NOT_FOUND] #3872

Open
3 tasks done
SebastianRzk opened this issue Mar 8, 2025 · 0 comments

Comments

@SebastianRzk
Copy link

SebastianRzk commented Mar 8, 2025

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

  1. Generate empty project from template: npx create-electron-app@latest my-app --template=webpack-typescript
  2. Change into the directory cd my-app
  3. Run npm run package

Additional information

When I switch with nvm to node 23.5, it works again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant