percy / cli

The Percy CLI is used to interact with, and upload snapshots to, percy.io via the command line.
https://docs.percy.io/docs/cli-overview
70 stars 43 forks source link

`percy` `--config` fails silently when `.js` config attempts an `import` or `require` #820

Open aresnick opened 2 years ago

aresnick commented 2 years ago

The problem

I'd like to import breakpoints for use in widths in .percy.js. The following .percy.js does not work (i.e. the widths are not respected, and instead the defaults of 375 and 1280 are used) when used via percy snapshot --config=.percy.js snapshots.js, but does when the require line is removed (similarly with the equivalent import).

const { breakpoints } = require("./site-data.js");

module.exports = {
  version: 2,
  snapshot: {
    widths: [378, 1283],
    minHeight: 1024,
    percyCSS: "",
  },
  discovery: {
    networkIdleTimeout: 100,
  },
  static: {
    cleanUrls: false,
  },
  upload: {
    files: "**/*.{png,jpg,jpeg}",
    ignore: "",
    stripExtensions: false,
  },
};

Environment

Details

None beyond the above.

Debug logs

It's not clear whether/how the Percy CLI has a --debug or --verbose option.

Code to reproduce issue

None beyond the above.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for more than 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.