Dropsource / monarch

Monarch is a tool for building Flutter widgets in isolation. It makes it easy to build, test and debug complex UIs.
https://monarchapp.io
MIT License
427 stars 21 forks source link

Could not create the embedder backing store. #121

Closed jtmuller5 closed 9 months ago

jtmuller5 commented 10 months ago

I'm not exactly sure what's causing the issue but occasionally I'm getting into a state where the preview pane is stuck on one story. I can select other stories but the preview doesn't update. I also see this error in the console:

[ERROR:flutter/shell/platform/embedder/embedder.cc(1077)] Could not create the embedder backing store.

Here's my code for the story. I use get_it as a service locator so I'm trying to "set up" get_it before the story runs:

Widget dentist_header_all_details() {
  if (!GetIt.instance.isRegistered<LastUsedService>()) {
    GetIt.instance.registerSingleton<LastUsedService>(LastUsedService());
  }

  if (!GetIt.instance.isRegistered<LocationService>()) {
    GetIt.instance.registerSingleton<LocationService>(LocationService());
  }

  if (!GetIt.instance.isRegistered<SharedPreferences>()) {
    GetIt.instance.registerSingleton<SharedPreferences>(MockSharedPreferences());
  }

  return DentistHeader(
    getTestDentist(),
    showLocation: true,
    showRating: true,
    showYearsInPractice: true,
    showInfoButton: true,
    showBuffer: true,
    showDistance: true,
  );
}

image

jtmuller5 commented 10 months ago

Quick follow up, I get this error even without using get_it or trying to perform setup steps before the story.

I'm on a Mac with M1 chip if that helps.

fertrig commented 9 months ago

I'll be looking at this soon.

fertrig commented 9 months ago

I merged the fix into main branch. We will be running tests now. I'll re-open this PR until I release the fix.

fertrig commented 9 months ago

Fix released with monarch 2.2.2, see release notes.