Hi,
I’m following the steps given in the serverless cloudflare workers guide, and have cobbled together my serverless.yml & javascript function:
service:
name: example-watcher
config:
accountId: 1234
zoneId: abcd
workers:
example-watcher-fn:
routes:
- foo.com/example-requests/*
provider:
name: cloudflare
plugins:
- serverless-cloudflare-workers
functions:
exampleWatcherFunction:
worker: example-watcher-fn
script: dist/main # webpacked away into ./dist/main.js ...
events:
- http:
url: foo.com/example-requests/response
method: GET
headers:
foo: bar
x-client-data: value
On running serverless deploy
I get this error, seemingly bubbling up from the serverless-cloudflare-workers plugin:
Serverless Error ---------------------------------------
Serverless plugin "serverless-cloudflare-workers" initialization errored: missing ) after argument list
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information -----------------------------
OS: darwin
Node Version: 6.14.4
Serverless Version: 1.32.0
I’ve stripped the javascript worker function down to do essentially nothing, but still the error pops up. Here’s the js file content being used:
addEventListener('fetch', event => {
event.respondWith(fetch(event.request))
});
Given that I can’t seem to find references of anyone else running into this problem, it’s likely something I’m doing wrong, but can’t see much detail around the problem, so not sure where to start here.
Has anyone else bumped into this before?
Thanks,
Chris.