Packages

wrangler

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

Your version

2.1.15

2 Nov 2022Where it was published

2.21.3 is the newest release of 2.x.

npm marks 2.1.15 as deprecated: Wrangler v2 is no longer supported. Please upgrade to Wrangler v4

In short

2 new1 fixed

Security

3 advisories affect 2.1.15; 3.114.17 fixes them

Release note

Patch Changes

  • Don't upload functions/ directory as part of wrangler pages publish

    If the root directory of a project was the same as the build output directory, we were previously uploading the functions/ directory as static assets. This PR now ensures that the functions/ files are only used to create Pages Functions and are no longer uploaded as static assets.

    Additionally, we also now do upload _worker.js, _headers, _redirects and _routes.json if they aren't immediate children of the build output directory. Previously, we'd ignore all files with this name regardless of location. For example, if you have a public/blog/how-to-use-pages/_headers file (where public is your build output directory), we will now upload the _headers file as a static asset.

  • Add a passThroughOnException() handler in Pages Functions

    This passThroughOnException() handler is not as good as the built-in for Workers. We're just adding it now as a stop-gap until we can do the behind-the-scenes plumbing required to make the built-in function work properly.

    We wrap your Pages Functions code in a try/catch and on failure, if you call passThroughOnException() we defer to the static assets of your project.

    For example:

    export const onRequest = ({ passThroughOnException }) => {
        passThroughOnException();
    
        x; // Would ordinarily throw an error, but instead, static assets are served.
    };
  • Added error logging for pages upload

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.