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

Cloudflare D1 template does not serve static assets #8

Open
taobojlen opened this issue Nov 24, 2024 · 0 comments
Open

Cloudflare D1 template does not serve static assets #8

taobojlen opened this issue Nov 24, 2024 · 0 comments

Comments

@taobojlen
Copy link

The Cloudflare D1 template (and likely the Cloudflare template too!) does not serve any static assets when you build & deploy it.

To reproduce:

  • Clone the template and cd into the folder
  • Make the change described in Cloudflare D1 Template - node:async_hooks error #2 to get builds to work
  • npm install && npm run build && npm start
  • Visit http://localhost:8787. In your terminal logs you'll see things like
[wrangler:inf] Ready on http://localhost:8787
[wrangler:inf] GET / 200 OK (44ms)
✘ [ERROR] Error: No route matches URL "/assets/entry.client-65eIbm27.js"
[wrangler:inf] GET /assets/entry.client-65eIbm27.js 404 Not Found (8ms)
[wrangler:inf] GET /assets/chunk-7R3XDUXW-BhZqBB9S.js 404 Not Found (12ms)
[wrangler:inf] GET /assets/root-Bn4Ngxxb.css 404 Not Found (12ms)
[wrangler:inf] GET /assets/with-props-CjRNnwNJ.js 404 Not Found (15ms)
[wrangler:inf] GET /assets/root-Dj4aptwQ.js 404 Not Found (15ms)
[wrangler:inf] GET /assets/home-BgHCt-4A.js 404 Not Found (15ms)
[wrangler:inf] GET /assets/logo-dark-pX2395Y0.svg 404 Not Found (3ms)
[wrangler:inf] GET /assets/logo-light-CVbx2LBR.svg 404 Not Found (3ms)

If you run things in dev with npm run dev, static assets are served correctly, but it breaks when you try to actually deploy it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant