You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This only affects dart projects; flutter projects seem to cope with the issue.
To reproduce, create a dart file in lib and require it from a clojure ns. Then in the the compiled dart for the ns, the path to the local dart file will have an extra ../. (Flutter seems ok with that but not Dart.)
This comes from an imbalance where libs from compiled nses are stored by the compiler with the "lib" prefix (to be able to relativize properly when test and other directories are involved.
Current workaround is to require the file as "package:projectname-as-set-in-pubspec-yaml/myfile.dart".
to automatically generate package:projectname-as-set-in-pubspec-yaml/ we need to parse the YAML. (In this case could we go as far as remove all relativization logic -- I'm still concerned about what happens when multiple source directories are in use)
we get the analyzer to give us the canonical lib
we ask the user to prefix with lib and fix the existence check and deal with relative/absolute libs path depending on where in the compiler we are (I believe the relative path matters only for dump-ns )
The text was updated successfully, but these errors were encountered:
import 'package:my_package/api.dart';
import '../lib/api.dart';
Dart thinks those are imports of two completely unrelated libraries. To avoid confusing Dart and yourself, follow these two rules:
Don’t use /lib/ in import paths.
Don’t use ../ to escape the lib directory.
This only affects dart projects; flutter projects seem to cope with the issue.
To reproduce, create a dart file in lib and require it from a clojure ns. Then in the the compiled dart for the ns, the path to the local dart file will have an extra
../
. (Flutter seems ok with that but not Dart.)This comes from an imbalance where libs from compiled nses are stored by the compiler with the "lib" prefix (to be able to relativize properly when
test
and other directories are involved.Current workaround is to require the file as
"package:projectname-as-set-in-pubspec-yaml/myfile.dart"
.(This https://stackoverflow.com/a/61604885 points to the fact that relative paths is just a meter of style.)
Possible solutions:
package:projectname-as-set-in-pubspec-yaml/
we need to parse the YAML. (In this case could we go as far as remove all relativization logic -- I'm still concerned about what happens when multiple source directories are in use)lib
and fix the existence check and deal with relative/absolute libs path depending on where in the compiler we are (I believe the relative path matters only fordump-ns
)The text was updated successfully, but these errors were encountered: