Skip to content

fix: add assets.directory to generated wrangler.jsonc#569

Merged
james-elicx merged 1 commit intomainfrom
opencode/jolly-knight
Mar 16, 2026
Merged

fix: add assets.directory to generated wrangler.jsonc#569
james-elicx merged 1 commit intomainfrom
opencode/jolly-knight

Conversation

@james-elicx
Copy link
Copy Markdown
Collaborator

Summary

  • Wrangler 4.69+ rejects an assets object that lacks a directory field, causing vinext deploy to fail with: The 'assets' property in your configuration is missing the required 'directory' property
  • Added directory: "dist/client" to the generated assets block in generateWranglerConfig() — this is always the correct value since @cloudflare/vite-plugin unconditionally writes static assets to dist/client/
  • Updated the existing test asserting the assets object shape, and added a dedicated test for the directory field

Notes

  • not_found_handling: "none" is intentional and unchanged — it ensures unmatched requests fall through to the user Worker (enabling SSR) rather than being handled by the asset worker directly

Fixes #219

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 16, 2026

Open in StackBlitz

npm i https://pkg.pr.new/vinext@569

commit: 7c5368d

@james-elicx james-elicx marked this pull request as draft March 16, 2026 20:05
@github-actions
Copy link
Copy Markdown

Example Preview Production Original
app-router-cloudflare preview production
pages-router-cloudflare preview production
app-router-playground preview production original
realworld-api-rest preview production
nextra-docs-template preview production
benchmarks preview production
hackernews preview production original

@james-elicx james-elicx changed the title fix: add assets.directory to generated wrangler.jsonc (required by wrangler 4.69+) fix: add assets.directory to generated wrangler.jsonc Mar 16, 2026
@james-elicx
Copy link
Copy Markdown
Collaborator Author

/bigbonk review

Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, minimal fix. The directory: "dist/client" value is correct — @cloudflare/vite-plugin unconditionally writes static assets there, and wrangler 4.69+ requires the field when assets is an object.

Tests look good: the existing assertion was updated to include the new field, and the dedicated test for assets.directory provides clear documentation of the requirement and why the value is correct.

No concerns.

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk bot commented Mar 16, 2026

Approved PR #569. The change is straightforward and correct:

  • Source change (deploy.ts:401-403): Adds directory: "dist/client" to the generated assets block in generateWranglerConfig(), with a clear comment explaining the wrangler 4.69+ requirement.
  • Test changes (deploy.test.ts): Updates the existing toEqual assertion to include the new field, and adds a dedicated test that specifically validates assets.directory is "dist/client" with comments documenting why.

The value "dist/client" is always correct because @cloudflare/vite-plugin unconditionally writes static assets to that path. The existing not_found_handling: "none" is preserved and correct for SSR fallthrough.

github run

@james-elicx james-elicx marked this pull request as ready for review March 16, 2026 20:13
@james-elicx james-elicx merged commit 69a0cff into main Mar 16, 2026
25 checks passed
@james-elicx james-elicx deleted the opencode/jolly-knight branch March 16, 2026 20:14
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

Successfully merging this pull request may close these issues.

vinext deploy fails with wrangler error: assets config missing required directory property when using output: "export" in next.config.ts

1 participant