capacitor-community / electron

Deploy your Capacitor apps to Linux, Mac, and Windows desktops, with the Electron platform! 🖥️
https://capacitor-community.github.io/electron/
MIT License
318 stars 58 forks source link

can't build ionic verion 7 with angular after add @capacitor-community/electron #276

Closed thebest2019 closed 5 months ago

thebest2019 commented 5 months ago

Describe the bug When running ionic build command on a Ionic7 Angular App i got the following message:

Environment Screenshot 2023-06-16 173341

To Reproduce Steps to reproduce the behavior: 1 ionic start myApp --type=angular 2 cd ./myApp 3 npm i @capacitor-community/electron

  1. npx cap add @capacitor-community/electron
  2. 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

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';



[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.