Patch Changes
-
#2103
f1fd62a1
Thanks @GregBrimble! - fix: Don't uploadfunctions/
directory as part ofwrangler 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 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
,_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 apublic/blog/how-to-use-pages/_headers
file (wherepublic
is your build output directory), we will now upload the_headers
file as a static asset. -
#2111
ab52f771
Thanks @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/catch
and 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
aa08ff7c
Thanks @nprogers! - Added error logging for pages upload