Closed JoueBien closed 7 months ago
Working through this issue I seam to have resolve it:
nodeIntegration: true,
to forge.config.ts
webPreferences
to:
webPreferences: {
contextIsolation: true,
nodeIntegration: true,
preload: MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY,
},
webpack.renderer.config.ts
to actually build as web by setting the target to target: "web",
This Resolved the "no using require in render" error message step 1 & 2 caused And it all works now. For those playing a long at home this is the commit where I resolved my issue: https://github.com/JoueBien/X32-OSC-Node-Bridge/commit/76f236f67be9104dc26407546fdfaf8ace876479
This would be soooooo much easier if there were upgraded guides.
Pre-flight checklist
Electron Forge version
7.2.0
Electron version
v25.3.1
Operating system
Windows 11 Pro
Last known working Electron Forge version
6.4.1
Expected behavior
run start and have the app start
Actual behavior
running start fails to start the app. Error message about webpack not having polyfills for modules is displayed. The app does not start. In some cases (in versions between 7.0.0 and 6.4.2) the app starts but the errors are dumped into the JS web inspector console instead of the cli.
Error message shown with 7.2.0:
Steps to reproduce
npm run start
Additional information
{ "name": "my-new-app", "productName": "my-new-app", "version": "1.0.0", "description": "My Electron application description", "main": ".webpack/main", "scripts": { "start": "electron-forge start", "package": "electron-forge package", "make": "electron-forge make", "publish": "electron-forge publish", "lint": "eslint --ext .ts,.tsx .", "fix": "eslint --fix --ext .tsx,.ts .", "installNode": "nvm install 20.11.0", "swapNode": "nvm use 20.11.0" }, "keywords": [], "author": { "name": "", "email": "" }, "license": "MIT", "devDependencies": { "@electron-forge/cli": "7.2.0", "@electron-forge/maker-deb": "7.2.0", "@electron-forge/maker-rpm": "7.2.0", "@electron-forge/maker-squirrel": "7.2.0", "@electron-forge/maker-zip": "7.2.0", "@electron-forge/plugin-auto-unpack-natives": "7.2.0", "@electron-forge/plugin-webpack": "7.2.0", "@josephmark/eslint-config-react": "^1.0.9", "@types/react": "^18.2.15", "@types/react-dom": "^18.2.7", "@types/uuid": "^9.0.2", "@types/validator": "^13.7.17", "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.62.0", "@vercel/webpack-asset-relocator-loader": "^1.7.3", "css-loader": "^6.8.1", "dotenv-webpack": "^8.0.1", "electron": "25.3.1", "eslint": "^8.45.0", "eslint-plugin-import": "^2.27.5", "fork-ts-checker-webpack-plugin": "^7.3.0", "node-loader": "^2.0.0", "prettier": "^3.0.0", "prettier-eslint": "^15.0.1", "style-loader": "^3.3.3", "ts-loader": "^9.4.4", "ts-node": "^10.9.1", "typescript": "~4.5.4" }, "dependencies": { "decimal.js": "^10.4.3", "electron-squirrel-startup": "^1.0.0", "fs-extra": "^11.1.1", "get-port": "^7.0.0", "osc": "^2.4.4", "px-par": "^0.2.3", "react": "^18.2.0", "react-dom": "^18.2.0", "rsuite": "^5.37.1", "serialport": "^11.0.0", "styled-components": "^6.0.4", "use-async-setstate": "^0.1.1", "use-debounce": "^9.0.4", "usehooks-ts": "^2.9.1", "uuid": "^9.0.0", "validator": "^13.9.0" } }