BirjuVachhani / spider

A small dart library to generate Assets dart code from assets folder.
https://spider.birju.dev/
Apache License 2.0
190 stars 20 forks source link

spider build command error #5

Closed madroidmaq closed 4 years ago

madroidmaq commented 4 years ago

version 0.3.0

An error occurred when I executed spider build command with the following information:

❯ spider build        
Unhandled exception:
type '_Directory' is not a subtype of type 'File'
#0      DartClassGenerator.createFileMap.<anonymous closure> (package:spider/src/dart_class_generator.dart:77:64)
#1      WhereIterator.moveNext (dart:_internal/iterable.dart:442:11)
#2      new List.from (dart:core-patch/array_patch.dart:47:19)
#3      Iterable.toList (dart:core/iterable.dart:400:5)
#4      DartClassGenerator.createFileMap (package:spider/src/dart_class_generator.dart:77:71)
#5      DartClassGenerator.process (package:spider/src/dart_class_generator.dart:46:22)
#6      DartClassGenerator.generate (package:spider/src/dart_class_generator.dart:42:5)
#7      Spider._generateFor (package:spider/spider.dart:70:15)
#8      Spider.build.<anonymous closure> (package:spider/spider.dart:49:21)
#9      ListMixin.forEach (dart:collection/list.dart:69:13)
#10     Spider.build (package:spider/spider.dart:48:25)
#11     processBuildCommand (file:///Users/madroid/.pub-cache/hosted/pub.dartlang.org/spider-0.3.0/bin/main.dart:150:12)
#12     main (file:///Users/madroid/.pub-cache/hosted/pub.dartlang.org/spider-0.3.0/bin/main.dart:47:9)
#13     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:305:32)
#14     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)
BirjuVachhani commented 4 years ago

@madroidmaq Could you please post your spider.yaml file here?

madroidmaq commented 4 years ago

like this:

groups:
  - path: assets/images
    class_name: Images
    package: res

by the way, Running spider --version will prompt Unable to get version!. As in the picture: image

BirjuVachhani commented 4 years ago

@madroidmaq This seems okay. Could you please provide your assets directory screenshot? also which OS you're using?

BirjuVachhani commented 4 years ago

I have created a separate issue for --version issue. Check it out here #6

madroidmaq commented 4 years ago

this is my assets directory screenshot:

image

BirjuVachhani commented 4 years ago

I think this is happening because of those 2.0x and 3.0x directories which should not happen but I see that you're using svgs then why do you need those directories?

BirjuVachhani commented 4 years ago

I'll check with those directories in play and will let you know...@madroidmaq

madroidmaq commented 4 years ago

I think this is happening because of those 2.0x and 3.0x directories which should not happen but I see that you're using svgs then why do you need those directories?

2.0x and 3.0x directories has some other webp files that have nothing to do with svg files.

BirjuVachhani commented 4 years ago

@madroidmaq I checked it and it is not the issue of those directories. This only happens on Mac. Windows is working fine.

BirjuVachhani commented 4 years ago

@madroidmaq This issue is caused due to wrong type checking. It is fixed in the version 0.3.4