oblador / loki

👁 Visual Regression Testing for Storybook
https://loki.js.org/
MIT License
1.77k stars 173 forks source link

Failed fetching stories because the server is down #142

Open nico-bellante opened 5 years ago

nico-bellante commented 5 years ago

I am running into an issue after switching to using the "chrome.docker" target.

When I try to run the loki test command (after ensuring the storybook server has been started and is running), image I get the following error: image

However, if I build storybook, and run loki --reactUri file:./build-storybook, it works fine.

This is my current loki configuration:

  "loki": {
    "chromeTolerance": 3,
    "configurations": {
      "chome.largeScreen": {
        "target": "chrome.docker",
        "width": 1920,
        "height": 1080,
        "deviceScaleFactor": 1,
        "mobile": false,
        "fitWindow": false
      },
      "chrome.laptop": {
        "target": "chrome.docker",
        "width": 1366,
        "height": 768,
        "deviceScaleFactor": 1,
        "mobile": false,
        "fitWindow": false
      }
    }
  }

I am not too familiar with Docker, so this might be a stupid question, but do I need to somehow start the storybook server inside the Docker container? I'd appreciate any help here.

nico-bellante commented 5 years ago

As a workaround, I have been just using the static build to run loki against

michalszajnecki commented 5 years ago

Try to run loki with defined port (storybook port). I am running storybook on port 40123 with command start-storybook -p 40123 so loki is starting with loki test --port 40123

TomGranot commented 5 years ago

Could https://github.com/oblador/loki/issues/143 be of service here? In addition, @nico-bellante if you can share your static configuration that would be great, currently failing using a static build.

fred-croix commented 4 years ago

Try to restart Docker Desktop agent if you are on Windows. Check also if your firewall blocks Hyper-V (virtualizer)

zaleGZL commented 4 years ago

I build storybook, and run loki --reactUri file:./build-storybook, it not working, What caused this? image

pjgoncalvez commented 3 years ago

Any update on this? got the same issue when following your getting started instructions, I'm using create-react-app

petr7555 commented 3 years ago

I have a similar question. When running loki test --port 6006 --configurationFilter chrome.laptop I need to start storybook on port 6006 in advance. If I run loki test --port 6006 --configurationFilter chrome.docker, do I need to start the storybook somehow?

My configurations:

configurations: {
    'chrome.laptop': {
      target: 'chrome.app',
      width: 414,
      height: 736,
    },
    'chrome.docker': {
      target: 'chrome.docker',
      width: 414,
      height: 736,
    },
    android: {
      target: 'android.emulator',
    },
  },
jWytrzes commented 2 years ago

Any updates? I am encountering this issue with target set to chrome.docker and also chrome.app. Loki doesn't see the storybook server on the default port nor some other port. It works fine with static build

p3k commented 2 years ago

same issue, switching to target: chrome.app works.

  "loki": {
    "configurations": {
      "chrome.laptop": {
        "target": "chrome.docker",
        "width": 1366,
        "height": 768,
        "deviceScaleFactor": 1,
        "mobile": false
      },
      "chrome.iphone7": {
        "target": "chrome.docker",
        "preset": "iPhone 7"
      }
    }
  }

image

sticeIO commented 1 year ago

For me the issue was storybook only listening locally on the host and not being accessible over the docker network. Solved by:

start-storybook -h "0.0.0.0"

Also setting host caused issues. Default/unset worked, only other value that did was --host "host.docker.internal"

Konstantine899 commented 1 year ago

In my case, the error fix was as follows. After auto-correcting imports in the application, the import was corrected in preview.js

003

After fixing everything worked.

004

005

Review your configuration files. I wish everyone well.