bennymeg / nx-electron

Electron schematics for nrwl nx platform
Apache License 2.0
309 stars 82 forks source link

Starter project with React does not work #210

Closed andirsun closed 1 year ago

andirsun commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. npx create-nx-workspace@14 (created a single react app 'react-test')
  2. npm install -D nx-electron
  3. nx g nx-electron:app electron-test --frontendProject=react-test
  4. nx serve electron-test

Electron throwed this error

❯ nx serve electron-test

> nx run electron-test:serve

asset main.js 17.3 KiB [compared for emit] (name: main) 1 related asset
asset main.preload.js 3.8 KiB [compared for emit] (name: main.preload) 1 related asset
asset assets/gitkeep_tmpl_ 13 bytes [compared for emit] [from: apps/electron-test/src/assets/gitkeep_tmpl_] [copied]
runtime modules 1.83 KiB 8 modules
built modules 8.4 KiB [built]
  cacheable modules 8.23 KiB
    modules by path ./apps/electron-test/src/app/ 7.28 KiB
      modules by path ./apps/electron-test/src/app/events/*.ts 2.56 KiB 2 modules
      modules by path ./apps/electron-test/src/app/*.ts 4.52 KiB 2 modules
      ./apps/electron-test/src/app/api/main.preload.ts 201 bytes [built] [code generated]
    ./apps/electron-test/src/main.ts 891 bytes [built] [code generated]
    ./apps/electron-test/src/environments/environment.ts 87 bytes [built] [code generated]
  external "electron" 42 bytes [built] [code generated]
  external "child_process" 42 bytes [built] [code generated]
  external "path" 42 bytes [built] [code generated]
  external "url" 42 bytes [built] [code generated]
webpack 5.75.0 compiled successfully in 202 ms
Type-checking in progress...
Debugger listening on ws://127.0.0.1:5858/e4a9ec0a-2f8f-48a4-be1d-6a8314cc1174
For help, see: https://nodejs.org/en/docs/inspector

(node:49044) electron: Failed to load URL: http://localhost:4200/ with error: ERR_CONNECTION_REFUSED
(Use `Electron --trace-warnings ...` to show where the warning was created)

No errors found.
Screenshot 2023-03-31 at 11 59 30 AM

Expected behavior A clear and concise description of what you expected to happen. Work out of the box Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

bennymeg commented 1 year ago

Please read this comment: https://github.com/bennymeg/nx-electron/issues/18#issuecomment-616982776