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
web_compilers: Need a better error when there are unsupported platforms #2200
Comments
Should we make a more general tool for this and just link it? I don't think we want gigantic error messages... |
gigantic error message is better than incomplete error message. I had to do a lot of guess work to figure out what was causing the problem! |
There are other use cases for wanting to know why you depend on some dart library though - which is why I was thinking a more general tool might make sense? |
I think a reasonable path forward here would be to output a file when we hit this case that represents all the paths to these bad libraries, probably DOT file format so users can easily visualize that in whatever they would like? |
Actually nvm I think something simpler is probably fine, will just output the shortest path to each unsupported module. Note this will be module paths not import paths. |
Ok, so I tried doing that with just the module graph and it ends up just being confusing, see this output from repo_manager before it was fixed.
The dart files here are misleading - none of the listed paths actually exist in terms of the real dart imports. Obviously the formatting etc could be cleaned up but I think we would have to drop back to the actual dart import paths to provide useful feedback which would be a fair bit more expensive. |
How can we go about debugging this in the meantime? I'm getting same error combined with "Unable to read module information for package:flutter, make sure you have a dependency on it in your pubspec.". Of course there is no flutter in pub deps or elsewhere, only flutter_web. I can't figure out what the problem is. The only thing that works is downgrading build_web_compilers to 1.2.2. Then the error "Unable to read module information for package:flutter" still prints, but it seems that it is not treated as fatal. Resulting web app works without observed defects. |
Ah. Finally found it. An import dart:io. |
What except |
I've removed every import from and web endpoint, except flutter/material and still getting an error |
If you are importing from Also flutter itself definitely has |
I have I'm already on latest flutter even tried master channel |
I don't believe |
|
Even tried this as entry point:
Still error |
Interesting... cc @jonahwilliams maybe something changed here so it is using this package for release builds as well. In that case we likely need to whitelist the flutter packages in the call to |
The most strange thing, that it were working fine yesterday, and still working fine in project which doesn't have dependencies in pubspec except flutter |
It is possible that this is compiling some additional entrypoints? There should be some additional log lines that tell you what app it was actually trying to compile (should be right above this). |
Here is full log, but I don't see anything about other entry-points
|
Huh, I think maybe flutter tool is stripping out our logger info lines? @jonahwilliams It looks like it did in fact compile the |
Well, IDK why I didn't tried it yesterday, but commenting out all other entrypoints (I have 3) fixed issue. So yeah, it's trying to build other entrypoints |
I've made simple project with two entrypoints to reproduce https://github.com/rostopira/bug_reproduce |
FWIW we've disabled the unsupported platform checks in the latest flutter |
note that you can use the |
Just went through this
I'd love to see the link going from
web/main.dart
through to the library causing the problem.The text was updated successfully, but these errors were encountered: