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

Dart app runs, but analyzer is unable to find package: import #22939

Closed
sethladd opened this issue Mar 20, 2015 · 4 comments
Closed

Dart app runs, but analyzer is unable to find package: import #22939

sethladd opened this issue Mar 20, 2015 · 4 comments
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.

Comments

@sethladd
Copy link
Contributor

Consider this code:

import 'package:path/path.dart';

main() {
  print('hello');
}

Here is the directory layout:

my_dir
  lib
    main.dart
    packages (symlink) => ../packages
  packages
    path (symlink) => ~/.pub-cache/...../path/lib

When I try to analyze:

sethladd@sethladd-macbookair ~/tmp/test2/lib $ dartanalyzer main.dart
Analyzing [main.dart]...
[error] Target of URI does not exist: 'package:path/path.dart' (/Users/sethladd/tmp/test2/lib/main.dart, line 1, col 8)
1 error found.

However, when I try to run, it works:

sethladd@sethladd-macbookair ~/tmp/test2/lib $ dart main.dart
hello

expected: I'd like to be able to run the analyzer on my file, and report errors and warnings.

Thanks for taking a look!


Attachment:
test2_and_test2_—bash—_141×51.png (64.42 KB)

@sethladd
Copy link
Contributor Author

A bit more research. dart2js can compile my main.dart app, so it's resolving package: the same way that VM is.

@DartBot
Copy link

DartBot commented May 21, 2015

This comment was originally written by off...@mikemitterer.at


I think I have a similar problem: https://code.google.com/p/dart/issues/detail?id=22907
Analyzer fails but it works with dart2js and in DartVM

@sethladd
Copy link
Contributor Author

Marked this as being blocked by #23373.

@sethladd
Copy link
Contributor Author

Will be fixed when issue #23373 lands


Added Accepted label.

@sethladd sethladd added Type-Defect area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels May 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
Projects
None yet
Development

No branches or pull requests

3 participants