panoply / syncify

🤝 WIP ~ Shopify theme upload, download and watch development tool.
MIT License
132 stars 12 forks source link

Errors when uploading causes syncify to break #37

Closed WolfGreyDev closed 2 months ago

WolfGreyDev commented 2 months ago

Problem

When uploading via the --upload flag, if a file contains errors, after those errors are displayed, syncify breaks and must be manually exited.

Steps to reproduce

  1. Have a theme in the source that contains errors (like the Shopify/Dawn official repo)
  2. Run syncify your-shopify-store --theme dev --upload

What's the expected behavior

After errors are displayed, syncify will gracefully exit, leaving the errors.

Example

ERROR 01 
│
│  Invalid block '@app': 'settings' is not a valid attribute

│
│  file:       ~/Users/ks/Sites/Shopify/your-shopify-store/source/sections/apps.liquid
│  details:    Unprocessable Entity
│  status:     422
│  processor:  SHOPIFY API
TypeError: Cannot read properties of undefined (reading 'width')
    at Li (/Users/ks/Sites/Shopify/your-shopify-store/node_modules/.pnpm/@syncify+cli@https+++codeload.github.com+panoply+syncify+tar.gz+69725f7796b1b9eb1c2f51f587199062e5934f7b_yaml@2.4.5/node_modules/@syncify/cli/dist/cli.js:100:10347)
    at kf (/Users/ks/Sites/Shopify/your-shopify-store/node_modules/.pnpm/@syncify+cli@https+++codeload.github.com+panoply+syncify+tar.gz+69725f7796b1b9eb1c2f51f587199062e5934f7b_yaml@2.4.5/node_modules/@syncify/cli/dist/cli.js:107:1904)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
panoply commented 2 months ago

Related to #38 and fixed in the RC brother: https://github.com/panoply/syncify/tree/rc1

WolfGreyDev commented 2 months ago

This issue is more to do with the TypeError

TypeError: Cannot read properties of undefined (reading 'width')
    at Li (/Users/ks/Sites/Shopify/your-shopify-store/node_modules/.pnpm/@syncify+cli@https+++codeload.github.com+panoply+syncify+tar.gz+69725f7796b1b9eb1c2f51f587199062e5934f7b_yaml@2.4.5/node_modules/@syncify/cli/dist/cli.js:100:10347)
    at kf (/Users/ks/Sites/Shopify/your-shopify-store/node_modules/.pnpm/@syncify+cli@https+++codeload.github.com+panoply+syncify+tar.gz+69725f7796b1b9eb1c2f51f587199062e5934f7b_yaml@2.4.5/node_modules/@syncify/cli/dist/cli.js:107:1904)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Shouldn't Syncify exit the process rather than failing and having the user send a signal interrupt?