Packages

wrangler

4.164.0 · 17 Nov 2026MIT OR Apache-2.049.3M / weekRepositoryHomepagenpmAtom feed

Your version

4.156.1

1 Nov 2026Where it was published

4.167.0 is the newest release of 4.x.

In short

4 security1 new3 fixed3 internal

  • Security

    Keep Pages development asset lookups within the configured directory

  • Security

    Deploy the requested directory when wrangler pages deploy <directory> is run as a Workers static-assets deploy

  • Security

    Fix repeated slashes in URL paths bypassing Pages Functions middleware

  • Security

    Validate OAuth error callbacks against the pending login

Release note

Patch Changes

  • Fix wrangler types --check reporting CRLF types files as out of date

    When worker-configuration.d.ts was checked out with CRLF line endings (for example with Git's core.autocrlf=true, the default on Windows), the runtime header kept a trailing \r and never matched the expected header. wrangler types --check then always failed, wrangler dev always warned that the types might be out of date, and cached runtime types were never reused. Generated types files are now read with either line ending.

  • Keep Pages development asset lookups within the configured directory

    Validate resolved asset paths relative to the Pages output directory, preventing neighboring files and directories with a shared name prefix from being served. This also applies to the Vitest Pages ASSETS helper. Assets inside the directory and existing not-found fallbacks retain their behavior.

  • Deploy the requested directory when wrangler pages deploy <directory> is run as a Workers static-assets deploy

    When wrangler pages deploy <directory> was carried out as a Workers static-assets deploy, the <directory> argument was only used to check for unsupported Pages features and was then dropped. Autoconfig detected an assets directory of its own instead, and when the project root contained an index.html it chose the whole project root, even when a narrower directory such as public had been requested. Source files and configuration outside the requested directory that were not excluded by .assetsignore could then be uploaded as public static assets.

    The requested directory is now validated before files are written and passed through to the deploy. Unconfigured projects are set up for static assets even when framework dependencies are present; existing Workers configs receive an --assets or legacy --site override. Projects configured through the Cloudflare Vite plugin alone keep their configuration and scripts, using the requested directory and an explicit or default compatibility date just for this deploy. Successful deployments without a config file are recorded in the project's .wrangler/deployments directory for that account and Worker, surviving dependency reinstalls. Repeat deploys verify the recorded version still belongs to the target Worker before allowing an update, preserving protection against name collisions and replacements.

  • Retry transient failures when starting a Workers assets upload session

    Asset manifest registration now uses the same bounded API retry policy as Worker uploads, including support for Retry-After. Temporary server errors no longer immediately abort an otherwise valid deployment. Persistent failures still surface the original error after the retry limit; this does not repair server-side issues affecting a specific Worker.

  • Fix repeated slashes in URL paths bypassing Pages Functions middleware

    Pages Functions now collapse repeated slashes when looking up middleware, so requests such as //secure/one run the same middleware as /secure/one. The original request URL and function-route matching are preserved. Middleware receives a functionPath prefix from the original URL so imported assets can still resolve their relative paths.

  • Validate OAuth error callbacks against the pending login

    All authorization callbacks, including ones without a code or error, now require the matching login state. Unrelated callbacks leave the login running so the authorization page can complete it, and control characters in provider error messages are displayed as escaped text.

  • Fix WebAssembly stack frames printing as at [object Object] in source-mapped errors

    WebAssembly frames in source-mapped error stack traces now show their original function and location instead of [object Object].

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.