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

最新(Flutter 2.10.5)環境でerrorが出て止まってしまう #1

Open
shachi opened this issue May 17, 2022 · 3 comments
Open
Labels
bug Something isn't working

Comments

@shachi
Copy link

shachi commented May 17, 2022

Describe the bug
Flutter 2.10.5 / Dart 2.16.2
import_path_converter 1.0.1

flutter pub run import_path_converter:main
として実行すると、

contains flutter: true
contains registrant: true
┏━━ Converting 221 dart filesUnhandled exception:
RangeError (index): Invalid value: Only valid value is 0: 1
#0 List.[] (dart:core-patch/growable_array.dart:281:36)
#1 _convertPath (package:import_path_converter/convert.dart:64:51)
fluttercommunity#2 convertImports (package:import_path_converter/convert.dart:33:16)
...

といったエラーが出て実行出来なくなりました

@shachi shachi added the bug Something isn't working label May 17, 2022
@shachi
Copy link
Author

shachi commented May 17, 2022

lib/conver.dart L64
String importPath = line.split(RegExp(r"'*'"))[1];

ここで、1個以下の時にエラーが出ているので、

String importPath = (line.split(RegExp(r"''")).length > 2)
? line.split(RegExp(r"'
'"))[1]
: "";

こんな感じに直すのはどうでしょう? (PR出せなかった)

@shachi
Copy link
Author

shachi commented May 18, 2022

あと、import の後に「'」でくくれば問題ないのですが、「"」でくくっているとエラーになりますね……

@ymgn-dev
Copy link
Owner

@shachi
調査進めていただいてありがとうございます。

申し訳ありませんが、今週が本業でかなり忙しくなってしまったため、修正対応が遅れそうです。
5月末~6月1週目までには時間作って対応できるはずですので、暫くの間お待ちいただければ幸いです。
進捗あり次第報告しますね。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants