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

Percy CLI takes snapshots successfully but throws an error in the end #1714

Open
jaysonwu991 opened this issue Sep 10, 2024 · 7 comments
Open
Labels
🧹 maintenance General maintenance

Comments

@jaysonwu991
Copy link

jaysonwu991 commented Sep 10, 2024

Description

Percy CLI takes snapshots successfully but still throws an error in the end, this makes the whole job failed on CI, the link from Finalized build #2821 actually can be open successfully.

Environment

node: 18.20.4
npm: 10.7.0
storybook: 8.2.9
@percy/cli: 1.29.3
@percy/storybook: 6.0.2

Command

percy storybook -d dist-storybook

Issue Log ID

36300846_build_36300846_cli_b977465ae0d39e39d9e48dffbd5978bae35dfc70

Issue Snapshot

image

Local Error Log

[percy:core] Build not created (0ms)
[percy:core] Detected error for percy build (2ms)
[percy:core] Failure: Snapshot command was not called (0ms)
[percy:core] Failure Reason: Snapshot Command was not called. please check your CI for errors (0ms)
[percy:core] Suggestion: Try using percy snapshot command to take snapshots (0ms)
[percy:core] Refer to the below Doc Links for the same (0ms)
[percy:core] * https://www.browserstack.com/docs/percy/take-percy-snapshots/ (0ms)
[percy:client] Sending Build Logs (126ms)
[percy:env] Detected ci as null (0ms)
[percy:env] Detected info as null (0ms)
[percy:core] Build's CLI and CI logs sent successfully. Please share this log ID with Percy team in case of any issues - cli_9d354772dc9d60d227732dc3e7ffe6d8eda5f4e3 (1673ms)
@unlikelyzero
Copy link

Possibly the same #1716

@jaysonwu991
Copy link
Author

Possibly the same #1716

Error log is not the same, just updated.

@prklm10
Copy link
Contributor

prklm10 commented Sep 16, 2024

@jaysonwu991 thanks for raising the issue we will check it out.

@prklm10
Copy link
Contributor

prklm10 commented Sep 18, 2024

@jaysonwu991 the error was thrown due to the error when running the storybook command. It is not the percy error. You can ignore this error by setting this env variable PERCY_EXIT_WITH_ZERO_ON_ERROR to true.

@prklm10
Copy link
Contributor

prklm10 commented Sep 18, 2024

Also @jaysonwu991 we don't know why storybook is throwing error. So can you please provide a reproducible example.

@jaysonwu991
Copy link
Author

Also @jaysonwu991 we don't know why storybook is throwing error. So can you please provide a reproducible example.

Will try to provide the example sooner, Thanks for tracking this issue.

@jaysonwu991
Copy link
Author

Got new error:

[percy:client] Finalizing build 36543095... (0ms)
[percy:core] Finalized build #2938: https://percy.io/1c744400/falcon/builds/36543095 (343ms)
[percy:client] Sending Build Logs (219ms)
[percy:core] Build's CLI and CI logs sent successfully. Please share this log ID with Percy team in case of any issues - 36543095_build_36543095_cli_dbe5a8ed09d6df41a99b7fd4912c102a2f57886d (824ms)
[percy:cli] Error: Object
    at withPage (file:///Users/jaysonwu/Projects/falcon/client/node_modules/@percy/storybook/dist/utils.js:156:51)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async takeStorybookSnapshots (file:///Users/jaysonwu/Projects/falcon/client/node_modules/@percy/storybook/dist/snapshots.js:198:9)
    at async Object.callback (file:///Users/jaysonwu/Projects/falcon/client/node_modules/@percy/storybook/dist/storybook.js:36:3)
    at async generatePromise (file:///Users/jaysonwu/Projects/falcon/client/node_modules/@percy/core/dist/utils.js:164:115)
    at async runCommandWithContext (file:///Users/jaysonwu/Projects/falcon/client/node_modules/@percy/cli-command/dist/command.js:136:3)
    at async percy (file:///Users/jaysonwu/Projects/falcon/client/node_modules/@percy/cli-command/dist/command.js:166:9)
    at async /Users/jaysonwu/Projects/falcon/client/node_modules/@percy/cli/bin/run.cjs:14:5 (5ms)
image

And is there anything wrong with AboutAirline Storybook file?

import { DesktopPageWidthWrapper } from '../story-helpers/Wrapper';

import AboutAirline from './AboutAirline';

import type { Meta } from '@storybook/react';

const props = {
  headerH2: 'Airline Header Here',
  aboutAirlineBlurb: 'Airline blurb here',
  panels: [
    {
      header: 'Section Header',
      image: 'image.jpg',
      text: 'Section text goes here, to be shown when the user expands the section',
    },
  ],
};
const propsWithImage = {
  ...props,
  airlineLogo:
    'https://content.skyscnr.com/afe9d4d28adc8055032b920b181a1504/ai-template-emirates-full-1.svg',
};

const meta: Meta<typeof AboutAirline> = {
  title: 'AboutAirline',
  component: AboutAirline,
  decorators: [
    (Story) => <DesktopPageWidthWrapper>{Story()}</DesktopPageWidthWrapper>,
  ],
};

export default meta;

export const WithoutImage = () => <AboutAirline {...props} />;
export const WithImage = () => <AboutAirline {...propsWithImage} />;

@prklm10 prklm10 added the 🧹 maintenance General maintenance label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧹 maintenance General maintenance
Projects
None yet
Development

No branches or pull requests

3 participants