chromaui/chromatic-cli

Turbosnap and NX not playing well together

bmayen opened this issue · 4 comments

After enabling onlyChanged in CI config or passing --only-changed to the CLI, my build fails with:

> nx run ui:build-storybook --output-dir /tmp/chromatic--688-LHFz6sdIVPBM --webpack-stats-json /tmp/chromatic--688-LHFz6sdIVPBM
 >  NX   Property 'webpackStatsJson' does not match the schema. '/tmp/chromatic--688-LHFz6sdIVPBM' should be a 'boolean'.
 
 >  NX   Running target "ui:build-storybook" failed
   Failed tasks:
   
   - ui:build-storybook
   
   Hint: run the command with --verbose for more details.
    → Command failed: npm run --silent build:storybook -- --output-dir /tmp/chromatic--688-LHFz6sdIVPBM --webpack-stats-json /tmp/chromatic--688-LHFz6sdIVPBM
Error: non-zero exit code

Looks like this has been addressed by NX team! nrwl/nx#12238

Actually, this still doesn't work for me even with latest NX updates.

Looks like that issue addressed correctly passing the args from the CLI to the builder. That is working as expected as we can see "--webpack-stats-json /tmp/chromatic--688-LHFz6sdIVPBM" results in the error "Property 'webpackStatsJson' does not match the schema. '/tmp/chromatic--688-LHFz6sdIVPBM' should be a 'boolean'."

So we're getting the path string passed to webpackStatsJson but the schema expects it to only be a boolean.

Opened separate ticket to address this in 6.5 instead of just v7 betas.

storybookjs/storybook#20520