Describe the bug
When running ionic build command on a Ionic7 Angular App i got the following message:
Environment
To Reproduce
Steps to reproduce the behavior:
1 ionic start myApp --type=angular
2 cd ./myApp
3 npm i @capacitor-community/electron
npx cap add @capacitor-community/electron
ionic build --prod
Expected behavior
PS C:\myApp> ionic build --prod
ng.cmd run app:build:production
✔ Browser application bundle generation complete.
./node_modules/@capacitor-community/electron/dist/core/index.js:93:8-18 - Warning: Critical dependency: the request of a dependency is an expression
./node_modules/@capacitor-community/electron/dist/core/index.js:128:98-170 - Warning: Critical dependency: the request of a dependency is an expression
./node_modules/@capacitor-community/electron/dist/core/index.js:37:8-27 - Error: Module not found: Error: Can't resolve 'electron' in 'myApp\node_modules\@capacitor-community\electron\dist\core'
./node_modules/@capacitor-community/electron/dist/core/index.js:40:6-19 - Error: Module not found: Error: Can't resolve 'fs' in 'myApp\node_modules\@capacitor-community\electron\dist\core'
./node_modules/@capacitor-community/electron/dist/core/index.js:42:6-21 - Error: Module not found: Error: Can't resolve 'path' in 'myApp\node_modules\@capacitor-community\electron\dist\core'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
./node_modules/mime-types/index.js:15:14-37 - Error: Module not found: Error: Can't resolve 'path' in 'myApp\node_modules\mime-types'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
Error: node_modules/@capacitor-community/electron/dist/core/ElectronSplashScreen.d.ts:1:27 - error TS2307: Cannot find module 'electron' or its corresponding type declarations.
1 import type Electron from 'electron';
[ERROR] An error occurred while running subprocess ng.
ng.cmd run app:build:production exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
Describe the bug When running ionic build command on a Ionic7 Angular App i got the following message:
Environment![Screenshot 2023-06-16 173341](https://github.com/capacitor-community/electron/assets/55440794/84319456-4600-449a-aa52-5b303dd04c26)
To Reproduce Steps to reproduce the behavior: 1 ionic start myApp --type=angular 2 cd ./myApp 3 npm i @capacitor-community/electron
Expected behavior PS C:\myApp> ionic build --prod
./node_modules/@capacitor-community/electron/dist/core/index.js:93:8-18 - Warning: Critical dependency: the request of a dependency is an expression
./node_modules/@capacitor-community/electron/dist/core/index.js:128:98-170 - Warning: Critical dependency: the request of a dependency is an expression
Warning: myApp\src\app\pages\check-list\check-list.page.ts depends on '@capacitor-community/electron'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
./node_modules/@capacitor-community/electron/dist/core/index.js:37:8-27 - Error: Module not found: Error: Can't resolve 'electron' in 'myApp\node_modules\@capacitor-community\electron\dist\core'
./node_modules/@capacitor-community/electron/dist/core/index.js:40:6-19 - Error: Module not found: Error: Can't resolve 'fs' in 'myApp\node_modules\@capacitor-community\electron\dist\core'
./node_modules/@capacitor-community/electron/dist/core/index.js:42:6-21 - Error: Module not found: Error: Can't resolve 'path' in 'myApp\node_modules\@capacitor-community\electron\dist\core'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
./node_modules/mime-types/index.js:15:14-37 - Error: Module not found: Error: Can't resolve 'path' in 'myApp\node_modules\mime-types'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
Error: node_modules/@capacitor-community/electron/dist/core/ElectronSplashScreen.d.ts:1:27 - error TS2307: Cannot find module 'electron' or its corresponding type declarations.
1 import type Electron from 'electron';