-
Notifications
You must be signed in to change notification settings - Fork 81
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
[DWDS] Can't set breakpoint in file with circular dependency #1692
Comments
Looked at this a bit more. With the circular dependency,
With circular dependency
Without circular dependency
Adding @annagrin who has more context. How should |
Circular dependencies result in JS modules that include all JS code for the dart included, so the module change is expected. Not sure what causes the issue, will look into it. |
Hi @annagrin, do you have any news about this? Thanks in advance! |
Investigated this - the problem is caused by disagreements between serving paths in dwds and relative paths in source maps: Example source directory tree
where
DDC output
We can solve this by making relative paths in modules uris and relative paths in source maps agree, ie making both match either the actual directory structure or the structure of module uris (which are created from This needs some experimentation and thinking, so not a trivial bug fix unfortunately. I suspect the fix should be in the frontend server since it writes out module metadata (that contains module uris) and source maps (that contain relative source paths), or flutter tools (that reads everything from the frontend server and starts dwds to serve the files). @jkydevelopment To work around the issue, is it possible to break the circular dependency by either putting all the mutual dependent code in one package, or pulling the code both need to a third package and making the two depend on it instead? |
@annagrin thank you for your response. I have just tried it by moving some common packages to a new In this case it's not possible to fix the circular dependency because of the dependency injection:
The only way I could fix this issue is by only using the main Any ideas about how could I structure this to avoid the circular dependency? |
I am working on the solution but not sure when it is going to be available (really depends where the change needs to be made, I am experimenting with a few ideas). As for the package dependencies, looks like the |
Proposed fix make server paths follow directory structure: Fix plan
|
The flag is true by default so the behavior does not change. Next steps: Use the flag for updated debugger module names: - Frontend server: make the current behavior controlled by the flag non-conditional - Frontend server: add more debugging names changes under the same flag, false by default - Dwds: make changes required for the new module names. - Flutter tools: when matching dwds changes roll to flutter, pass the flag to the frontend server again. - Cleanup: - Frontend server: make new behavior default - Flutter tools: remove uses of the flag. - Frontend server: remove the flag. Towards: dart-lang/webdev#1692 Helps: flutter#106727
…09791) The flag is true by default so the behavior does not change. Next steps: Use the flag for updated debugger module names: - Frontend server: make the current behavior controlled by the flag non-conditional - Frontend server: add more debugging names changes under the same flag, false by default - Dwds: make changes required for the new module names. - Flutter tools: when matching dwds changes roll to flutter, pass the flag to the frontend server again. - Cleanup: - Frontend server: make new behavior default - Flutter tools: remove uses of the flag. - Frontend server: remove the flag. Towards: dart-lang/webdev#1692 Helps: #106727
We should verify whether or not this is still an issue. |
See flutter/flutter#106727 for details.
How to reproduce:
lib/main_dev.dart
tomain.dart
flutter_tools
using the example appaccount_presentation/controllers/sign_in_controller.dart
Note:
package:router/router.dart
) is commented out, themoduleForSource
method correctly returnspackages/account_presentation/controllers/sign_in_controller.dart
.packages/home/pages/welcome_page.dart
.The text was updated successfully, but these errors were encountered: