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

[Bug]: theme pull - cannot read properties of undefined, when pulling an empty javascript file #4476

Closed
2 tasks done
bincani opened this issue Sep 19, 2024 · 1 comment
Closed
2 tasks done
Labels
Area: @shopify/theme @shopify/theme package issues #gsd:40767 Fortify local development experience for Liquid themes important second highest severity for theme related bug Type: Bug Something isn't working

Comments

@bincani
Copy link

bincani commented Sep 19, 2024

Please confirm that you have:

  • Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
  • Reproduced the issue in the latest CLI version.

In which of these areas are you experiencing a problem?

Other

Expected behavior

shopify theme pull --path ./repo --live -e prod --only path/to/empty/file.js

Actual behavior

Error: Cannot read properties of undefined (reading 'length')

Verbose output

$ shopify theme pull --path ./repo --live -e prod --only path/to/empty/file.js

...
2024-09-19T00:06:17.939Z: Request to https://theme-kit-access.shopifyapps.com/cli/admin/api/unstable/themes/130714370137/assets.json?asset%5Bkey%5D=path%2Fto%2Fempty%2Ffile.jscompleted in 539 ms
With response headers:

  • cache-control: max-age=0, private, must-revalidate
  • content-type: application/json; charset=utf-8
  • etag: W/"95921be8f9373af23266463630e25389"
  • server-timing: processing;dur=303, socket_queue;dur=1.973, cfRequestDuration;dur=528.999805
  • x-request-id: 59c02d6a-c4ed-43ca-a3ee-99079f664063-1726704377

╭─ error ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Cannot read properties of undefined (reading 'length') │
│ │
│ To investigate the issue, examine this stack trace: │
│ at buildThemeAsset (usr/local/lib/node_modules/@shopify/cli/dist/index.js:145173) │
│ at fetchThemeAsset (usr/local/lib/node_modules/@shopify/cli/dist/index.js:145207) │
│ at processTicksAndRejections (node:internal/process/task_queues:95) │
│ at async downloadFile (usr/local/lib/node_modules/@shopify/cli/dist/index.js:149722) │
│ at async runTask2 (usr/local/lib/node_modules/@shopify/cli/dist/chunk-7QTS6ZWN.js:31139) │
│ at (usr/local/lib/node_modules/@shopify/cli/dist/chunk-7QTS6ZWN.js:31153) │
│ │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Reproduction steps

  1. run shopify theme pull on an empty javascript file

Operating System

linux

Shopify CLI version (check your project's package.json if you're not sure)

3.67.0

Shell

bash

Node version (run node -v if you're not sure)

v20.12.2

What language and version are you using in your application?

javascript

@bincani bincani added the Type: Bug Something isn't working label Sep 19, 2024
@karreiro
Copy link
Contributor

Closing this issue in favor of #4470. Thank you for reporting, @bincani!

While the team works on a fix for that, could you use the --legacy flag as a temporary workaround? If it doesn't work, please let us know at #4470.

Thanks again for reporting!

@karreiro karreiro added Area: @shopify/theme @shopify/theme package issues #gsd:40767 Fortify local development experience for Liquid themes important second highest severity for theme related bug labels Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: @shopify/theme @shopify/theme package issues #gsd:40767 Fortify local development experience for Liquid themes important second highest severity for theme related bug Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants