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 assets /assets/* returns 404 #4607

Closed
2 tasks done
wiebekaai opened this issue Oct 9, 2024 · 1 comment · Fixed by #4624
Closed
2 tasks done

[Bug]: Theme assets /assets/* returns 404 #4607

wiebekaai opened this issue Oct 9, 2024 · 1 comment · Fixed by #4624
Assignees
Labels
Area: @shopify/theme @shopify/theme package issues #gsd:40767 Fortify local development experience for Liquid themes Theme Sev-2 second highest severity for theme related bug Type: Bug Something isn't working

Comments

@wiebekaai
Copy link

wiebekaai commented Oct 9, 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?

Theme

Expected behavior

We use Vite to serve assets in development and when an asset is referenced (such as url('Inter-Regular.woff2') in CSS), we proxy the http://localhost:5173/Inter-Regular.woff2 request to http://127.0.0.1:9292/assets/Inter-Regular.woff2. With --legacy enabled these return the files.

Actual behavior

Returns a 404.

Verbose output

GET /assets/Inter-Regular.woff2
2024-10-09T08:31:02.851Z: → Rendering https://[...].com/assets/Inter-Regular.woff2?_fd=0&pb=0 (with )...
2024-10-09T08:31:03.148Z: Request to https://[...].com/assets/Inter-Regular.woff2?_fd=0&pb=0 completed in 297 ms
With response headers:

  • cache-control: no-cache, no-store
  • content-type: font/woff2; charset=utf-8
  • server-timing: processing;dur=83;desc="gc:49", db;dur=10, parse;dur=1, render;dur=5, asn;desc="50266", edge;desc="AMS", country;desc="NL", theme;desc="142490042499", pageType;desc="404", servedBy;desc="hq2k", requestID;desc="f4ee6045-cc21-4f63-891c-e17ddefa5ed1-1728462662", cfRequestDuration;dur=262.999773
  • x-request-id: f4ee6045-cc21-4f63-891c-e17ddefa5ed1-1728462662

2024-10-09T08:31:03.149Z: ← 404 (request_id: f4ee6045-cc21-4f63-891c-e17ddefa5ed1-1728462662)

Reproduction steps

  1. Add an asset to the assets/ directory
  2. Start shopify theme dev
  3. Visit the asset, for example http://127.0.0.1:9292/assets/Inter-Regular.woff2

Operating System

MacOS 14.6.1 (23G93)

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

3.68.0

Shell

zsh

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

v22.6.0

What language and version are you using in your application?

No response

@wiebekaai wiebekaai added the Type: Bug Something isn't working label Oct 9, 2024
@gordonhirsch gordonhirsch added the Area: @shopify/theme @shopify/theme package issues label Oct 9, 2024
@mgmanzella
Copy link
Contributor

👋 thanks for reporting! i can reproduce this issue, it seems to be an unsupported feature in the new typescript only implementation of the dev server. please use the --legacy flag while we fix this. thanks again 🙏

@mgmanzella mgmanzella added Theme Sev-2 second highest severity for theme related bug #gsd:40767 Fortify local development experience for Liquid themes labels Oct 9, 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 Theme Sev-2 second highest severity for theme related bug Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants