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

Typing rs in the terminal does not restart the dev environment app #2319

Closed
3 tasks done
b-zurg opened this issue Jun 10, 2021 · 5 comments · Fixed by #2904
Closed
3 tasks done

Typing rs in the terminal does not restart the dev environment app #2319

b-zurg opened this issue Jun 10, 2021 · 5 comments · Fixed by #2904
Assignees
Labels
bug plugin/webpack Issues or pull requests related to first-party webpack plugins/templates

Comments

@b-zurg
Copy link
Contributor

b-zurg commented Jun 10, 2021

Preflight Checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Issue Details

  • Electron Forge Version:
    6.0.0-beta.57
  • Electron Version:
    v11.3.0
  • Operating System:
    Macos big sur latest

Expected Behavior

I expect to be able to run electron forge and type in the terminal rs and have the entire app restart.

Actual Behavior

The app does not restart when I type in rs

Additional Information

I think this could be related to the recent changes in the webpack plugin upgrade to webpack version 5

@b-zurg b-zurg added the bug label Jun 10, 2021
@malept malept added the plugin/webpack Issues or pull requests related to first-party webpack plugins/templates label Jun 11, 2021
@ltabis
Copy link

ltabis commented Jul 7, 2021

Hey @b-zurg, I've encountered this issue in a project, and couldn't find any solution to fix this problem. I think it's definitely a webpack 5 bug since I've just updated to that version and that's when the problem occured.

I've nonetheless managed to re-enable the rs command by passing the env variable DEBUG='electron-forge:*' to the start script (I was trying to see what electron-forge was doing under the hood to find the problem) in my package.json like so:

 "scripts": {
    "start": "cross-env DEBUG='electron-forge:*' NODE_ENV=development electron-forge start --inspect-electron",
  },

(cross-env is used to enable windows devs to use the same config as linux users)

I know it's not a good solution and that it might not work for you, but please give it a try while this is being worked on.
(btw I have no idea why enabling logs would re-enable the rs command :/)

@rumtraubenuss
Copy link

rs + enter in terminal does also not work in 6.0.0-beta.61.

@ltabis setting the DEBUG env as you mentioned re-enables the rs command for me. 👍💯
For a quick test without altering package.json prefixing the npm start command like this worked for me (on mac os):
DEBUG='electron-forge:*' npm start

@tr3ysmith
Copy link

So maybe this is related, but on my Mac, I'm seeing this same issue not only with Electron Forge but also with nodemon... maybe related?

@wobedi
Copy link

wobedi commented Jan 19, 2022

An even more minimal workaround (which still works for me) is to scope the DEBUG variable to just the webpack plugin:

DEBUG='electron-forge:plugin:webpack' npm start

phonofidelic pushed a commit to phonofidelic/tapes-electron-client that referenced this issue Jun 3, 2022
@clavin clavin self-assigned this Jun 23, 2022
@clavin
Copy link
Member

clavin commented Jun 24, 2022

After a very deep dive, I've figured out that this is caused by ora (which we use for those little command-line spinners) which internally uses node:readline. When ora completes, it closes the readline session which, in turn, pauses the input stream, due to an undocumented quirk in node:readline. This means that stdin is paused and thus we never receive the data.

Filed an upstream bug and PR for this: sindresorhus/ora#209

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug plugin/webpack Issues or pull requests related to first-party webpack plugins/templates
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants