New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #5619 - Update Cloudflare Templates #5620

merged 2 commits into from Dec 20, 2018


None yet
4 participants
Copy link

benwillkommen commented Dec 20, 2018

What did you implement:

Closes #5619

How did you implement it:

I did the following:

  • Bumped the version of the serverless-cloudflare-workers plugin specified in the package.json files of the Cloudflare templates from 0.1.1 to 1.0.5
  • Corrected function name properties in serverless.yml files of the Cloudflare templates so that the value of the name property matches the declared name of the function (serverless-cloudflare-workers throws an exception on serverless deploy if these names do not match).
  • Updated the docs to reflect this.

How can we verify it:

To reproduce the issue, you can simply serverless create --template cloudflare-workers, update the generated serverless.yml file with your Cloudflare account id, zone id, and zone url (in the events.http.url property), then attempt to serverless deploy. This will fail with the message "Cannot Convert undefined or null to object".

To verify this fix, I tested locally by creating a new project from this fork, e.g.

C:\dev\serverless [master ≡]> node .\bin\serverless create --template cloudflare-workers --path "..\cf-worker-template-test"

After adding your account id, zone id, and zone url to the project generated from this fork, serverless deploy should successfully deploy your "hello world" worker.


  • Write tests
  • Write documentation
  • Fix linting errors
  • Make sure code coverage hasn't dropped
  • Provide verification config / commands / resources
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: NO

benwillkommen added some commits Dec 20, 2018

Fixed cloudflare templates
Updated package.json from 0.1.1 to 1.0.5 of serverless-cloudflare-workers plugin for both cloudflare templates. Fixed an issue with the serverless.yml files in the templates: serverless-cloudflare-workers does throws an exception on serverless deploy of the name property of the function does not match the function name.
Updated docs
Changed docs so that name property of the matches the declared function name in serverless.yml examples, added comment indicating they must match. Fixed two typos.
@@ -9,6 +9,6 @@
"author": "cloudflare",
"license": "MIT",
"devDependencies": {
"serverless-cloudflare-workers": "0.1.1"
"serverless-cloudflare-workers": "1.0.5"

This comment has been minimized.


jspies Dec 20, 2018


nice thanks!


jspies approved these changes Dec 20, 2018


This comment has been minimized.

Copy link

dschep commented Dec 20, 2018

Thanks for the review @jspies!


dschep approved these changes Dec 20, 2018

@dschep dschep merged commit a06f59c into serverless:master Dec 20, 2018

2 of 3 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
continuous-integration/travis-ci/pr The Travis CI build passed
coverage/coveralls Coverage remained the same at 90.781%

dschep added a commit that referenced this pull request Jan 9, 2019

v1.36.0 release!
 - [Log AWS SDK calls in debug mode](#5604)
 - [Added currently supported regions for GCP functions](#5601)
 - [Update Cloudflare Templates](#5620)
 - [AWS: Validate rate/cron syntax before Deploy](#5635)
 - [Fix error log output](#5378)
 - [Support for native async/await in AWS Lambda for aws-nodejs-typescript template ](#5607)
 - [aws-csharp create template uses handler-specific artifact](#5411)
 - [change behaviour on initial stack create failed](#5631)
 - [Add warning for multiple functions having same handler](#5638)
 - [AWS: Add API Gateway stage name validation.](#5639)

@dschep dschep referenced this pull request Jan 9, 2019


v1.36.0 release! #5670

@shortjared shortjared added this to the 1.36.0 milestone Jan 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment