Issue deploying worker with serverless

#1

I have developed a simple worker in a file called hello.js

addEventListener(‘fetch’, event => {
event.respondWith(handleRequest(event.request));
});

async function handleRequest(request) {
return new Response(Hello World);
}

Here is my serverless.yml file

service:
name: hello
config:
accountId: (env.CLOUDFLARE_ACCOUNT_ID) zoneId: (env.CLOUDFLARE_ZONE_ID)

provider:
name: cloudflare

plugins:

  • serverless-cloudflare-workers

functions:
hello:
name: hello
worker: hello
script: hello
events:
- http:
url: shelterme.com.au/hello/*
method: GET
headers:
foo: bar

When i attempt a deploy i get the following

Serverless: Packaging service…
Serverless: Excluding development dependencies…

Type Error ---------------------------------------------

Cannot destructure property multiscript of ‘undefined’ or ‘null’.

 For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com

Your Environment Information ---------------------------
OS: darwin
Node Version: 8.11.3
Serverless Version: 1.40.0

Any clues?

#2

Found the issue with incorrect serverless.yml file

1 Like