github cloudflare/workers-sdk wrangler@2.1.15

latest releases: wrangler@3.78.6, miniflare@3.20240909.4, @cloudflare/vitest-pool-workers@0.5.6...
22 months ago

Patch Changes

  • #2103 f1fd62a1 Thanks @GregBrimble! - fix: 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.

  • #2111 ab52f771 Thanks @GregBrimble! - feat: 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.
    };
  • #2117 aa08ff7c Thanks @nprogers! - Added error logging for pages upload

Don't miss a new workers-sdk release

NewReleases is sending notifications on new releases.