Repository navigation
wrangler@2.1.15
Patch Changes
-
#2103
f1fd62a1Thanks @GregBrimble! - fix: Don't uploadfunctions/directory as part ofwrangler pages publishIf 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 thefunctions/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,_redirectsand_routes.jsonif 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 apublic/blog/how-to-use-pages/_headersfile (wherepublicis your build output directory), we will now upload the_headersfile as a static asset. -
#2111
ab52f771Thanks @GregBrimble! - feat: Add apassThroughOnException()handler in Pages FunctionsThis
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/catchand on failure, if you callpassThroughOnException()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
aa08ff7cThanks @nprogers! - Added error logging for pages upload