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

Hot restart fails on Windows #56

Closed
fertrig opened this issue Dec 20, 2022 · 0 comments · Fixed by #74
Closed

Hot restart fails on Windows #56

fertrig opened this issue Dec 20, 2022 · 0 comments · Fixed by #74
Labels
bug Something isn't working windows Related to the Windows operating system.

Comments

@fertrig
Copy link
Collaborator

fertrig commented Dec 20, 2022

Hot reload works as expected on Windows. This issue is specific to hot restart on Windows. Most users do hot reloads thus this issue affects a small number of users.

Doing a hot restart on Windows fails with the message below:

Target copy_flutter_bundle failed: Exception: Flutter failed to copy C:\Users\USER\development\scratch\my_sample_project\.dart_tool\flutter_build\02f4ff5d73af275b6d70fef5f53c5366\app.dill to .monarch\flutter_assets\kernel_blob.bin due to unknown error. The flutter tool cannot access the file or directory.
Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user.

Failed to build bundle.

However, sometimes the first hot restart works. If the first hot restart works, the second one, and subsequent ones, fail.

@fertrig fertrig added windows Related to the Windows operating system. bug Something isn't working labels Dec 20, 2022
fertrig added a commit to fertrig/monarch that referenced this issue Feb 17, 2023
- Due to Windows file system we have to close the preview before
  we bundle the source code
- Implemented willRestartPreview so Windows code can cleanly close
  preview window before we bundle
- Changed restartPreview to handle the new process
- Required changes to cli, monarch_definitions, monarch_grpc,
  windows, preview_api
- Fixes Dropsource#56
- Pending cleanup of logs and dependency overrides
fertrig added a commit that referenced this issue Feb 20, 2023
- Affects cli, windows, preview_api, monarch_grpc, monarch_definitions
- Detect hot reload crash and notify user of workaround
- Handle grpc error during hot reload request
- Detect "Unable to use class...which is not loaded yet" from monarch-app stderr
- Notify user of workaround
- Use latest versions of package monarch_grpc, monarch_definitions
- Fixes #56 (hot restart on Windows).
- windows: Implements willRestartPreview so Windows C++ code can cleanly close preview window before we bundle
- windows: Changes restartPreview to handle the new process
- windows: Inform user that preview window will re-open
- Published new versions of packages monarch_definitions and monarch_grpc to support willRestartPreview flow.
- cli: refactor task managers reload logic into base class, hot-restart and hot-reload now share the same reload flow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working windows Related to the Windows operating system.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant