[GH-ISSUE #219] vinext deploy fails with wrangler error: assets config missing required directory property when using output: "export" in next.config.ts #53

Closed
opened 2026-05-06 12:36:51 +02:00 by BreizhHardware · 2 comments

Originally created by @vikas5914 on GitHub (Mar 1, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/219

Originally assigned to: @james-elicx on GitHub.

Description

When using output: "export" in next.config.ts (static export mode), running vinext deploy fails during the wrangler deploy step. The build completes successfully (all 5 steps), but wrangler rejects the config because the assets property is missing the required directory field.

This happens because vinext deploy generates (or scaffolds) a wrangler.jsonc with an assets block that does not include directory. Wrangler 4.69.0 requires this field when assets is present.

Steps to Reproduce

  1. Create a Next.js App Router project with vinext
  2. Set output: "export" in next.config.ts:
    import type { NextConfig } from "next";
    
    const nextConfig: NextConfig = {
      output: "export",
    };
    
    export default nextConfig;
    
  3. Run bunx vinext deploy
  4. Build succeeds (all 5 steps complete), but deploy fails

Error Output

vinext deploy

  Project: vinext-static-out
  Router:  App Router
  ISR:     none

  Building for Cloudflare Workers...

[1/5] analyze client references...
...
[5/5] build ssr environment...
...

  Deploying to production...
Error: Command failed: .../node_modules/.bin/wrangler deploy

✘ [ERROR] The `assets` property in your configuration is missing the required `directory` property.

Environment

  • vinext: 0.0.17
  • wrangler: 4.69.0
  • vite: 7.3.1
  • next: 16.1.6
  • bun: latest
  • OS: macOS

next.config.ts

import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  output: "export",
};

export default nextConfig;

wrangler.jsonc (generated by vinext)

{
  "$schema": "node_modules/wrangler/config-schema.json",
  "name": "vinext-static-out",
  "compatibility_date": "2026-03-01",
  "compatibility_flags": ["nodejs_compat"],
  "main": "./worker/index.ts",
  "assets": {
    "not_found_handling": "none",
    "binding": "ASSETS"
  },
  "images": {
    "binding": "IMAGES"
  }
}
Originally created by @vikas5914 on GitHub (Mar 1, 2026). Original GitHub issue: https://github.com/cloudflare/vinext/issues/219 Originally assigned to: @james-elicx on GitHub. ## Description When using `output: "export"` in `next.config.ts` (static export mode), running `vinext deploy` fails during the wrangler deploy step. The build completes successfully (all 5 steps), but wrangler rejects the config because the `assets` property is missing the required `directory` field. This happens because `vinext deploy` generates (or scaffolds) a `wrangler.jsonc` with an `assets` block that does not include `directory`. Wrangler 4.69.0 requires this field when `assets` is present. ## Steps to Reproduce 1. Create a Next.js App Router project with vinext 2. Set `output: "export"` in `next.config.ts`: ```ts import type { NextConfig } from "next"; const nextConfig: NextConfig = { output: "export", }; export default nextConfig; ``` 3. Run `bunx vinext deploy` 4. Build succeeds (all 5 steps complete), but deploy fails ## Error Output ``` vinext deploy Project: vinext-static-out Router: App Router ISR: none Building for Cloudflare Workers... [1/5] analyze client references... ... [5/5] build ssr environment... ... Deploying to production... Error: Command failed: .../node_modules/.bin/wrangler deploy ✘ [ERROR] The `assets` property in your configuration is missing the required `directory` property. ``` ## Environment - **vinext**: 0.0.17 - **wrangler**: 4.69.0 - **vite**: 7.3.1 - **next**: 16.1.6 - **bun**: latest - **OS**: macOS ## `next.config.ts` ```ts import type { NextConfig } from "next"; const nextConfig: NextConfig = { output: "export", }; export default nextConfig; ``` ## `wrangler.jsonc` (generated by vinext) ```jsonc { "$schema": "node_modules/wrangler/config-schema.json", "name": "vinext-static-out", "compatibility_date": "2026-03-01", "compatibility_flags": ["nodejs_compat"], "main": "./worker/index.ts", "assets": { "not_found_handling": "none", "binding": "ASSETS" }, "images": { "binding": "IMAGES" } } ```
Author
Owner

@nathanschram commented on GitHub (Mar 13, 2026):

Hey - ran into this same thing looking at vinext's deploy path. I think the issue is in generateWranglerConfig() in packages/vinext/src/deploy.ts - it looks like it generates the assets block with not_found_handling and binding but doesn't include directory, which wrangler 4.69.0+ requires when assets is specified as an object.

From reading the source, it looks like vinext v0.0.17 doesn't have a static export code path yet - detectProject() doesn't appear to read next.config at all, so output: "export" seems to be effectively ignored. The build still seems to run the standard Worker pipeline (which would explain why your 5 build steps succeed), but then wrangler rejects the generated config at deploy time.

There's already a PR in progress (#221) that should add proper static export support - directory in the config, a static export build pipeline, and skipping Worker-only deps. It's still in draft but the approach looks right.

In the meantime, a couple of workarounds depending on what you're after:

  • If you actually need SSR/edge rendering - removing output: "export" from next.config.ts should let vinext do a normal Worker deployment

  • If you specifically want a static site - you could probably bypass vinext entirely and go straight through Cloudflare Pages: next build && npx wrangler pages deploy ./out. Pages is purpose-built for static assets so you shouldn't need the Worker wrapper at all

<!-- gh-comment-id:4053151609 --> @nathanschram commented on GitHub (Mar 13, 2026): Hey - ran into this same thing looking at vinext's deploy path. I think the issue is in `generateWranglerConfig()` in `packages/vinext/src/deploy.ts` - it looks like it generates the `assets` block with `not_found_handling` and `binding` but doesn't include `directory`, which wrangler 4.69.0+ requires when `assets` is specified as an object. From reading the source, it looks like vinext v0.0.17 doesn't have a static export code path yet - `detectProject()` doesn't appear to read `next.config` at all, so `output: "export"` seems to be effectively ignored. The build still seems to run the standard Worker pipeline (which would explain why your 5 build steps succeed), but then wrangler rejects the generated config at deploy time. There's already a PR in progress (#221) that should add proper static export support - `directory` in the config, a static export build pipeline, and skipping Worker-only deps. It's still in draft but the approach looks right. In the meantime, a couple of workarounds depending on what you're after: - **If you actually need SSR/edge rendering** - removing `output: "export"` from next.config.ts should let vinext do a normal Worker deployment - **If you specifically want a static site** - you could probably bypass vinext entirely and go straight through Cloudflare Pages: `next build && npx wrangler pages deploy ./out`. Pages is purpose-built for static assets so you shouldn't need the Worker wrapper at all
Author
Owner

@james-elicx commented on GitHub (Mar 13, 2026):

Aiming to ship proper pre-rendering support towards the tail end of this weekend, and closely follow that with the fixes for this.

<!-- gh-comment-id:4058014879 --> @james-elicx commented on GitHub (Mar 13, 2026): Aiming to ship proper pre-rendering support towards the tail end of this weekend, and closely follow that with the fixes for this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#53
No description provided.