xd-to-flutter-plugin icon indicating copy to clipboard operation
xd-to-flutter-plugin copied to clipboard

Automatic hot reload can generate Flutter debug console errors in some cases

Open gskinner opened this issue 4 years ago • 1 comments
trafficstars

Flutter's automatic hot reload has a 50ms debounce, but because we parse and write widgets sequentially sometimes the delay between writes exceeds this. In some cases, that can lead to errors in Flutter's debug console because it attempts a build while subsequent files are still being written.

It should be possible to defer all file writes to the end of a parse, which should mostly resolve the issue (barring any massive files that take >50ms to write, or any file system delays).

I'm chatting with Dan, who devs the Flutter plugin for VS Code about more reliable solutions.

gskinner avatar Feb 04 '21 19:02 gskinner

Chatting with Dan, it sounds like the best solution will be deferring file writes, at least for now. This will take some restructuring, and might make sense to combine with work on #62 (NOTE: images should probably be written first if we auto export them)

gskinner avatar Feb 08 '21 15:02 gskinner