serverless / serverless/examples

Failing with "Parameter 'url' must be a string, not undefined"

Open
#181 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
11.5k
Forks
4.4k
Avg merge
2h 55m
Merged PRs (30d)
3

Description

Hi,
I am new to Serverless and Node.js. I am trying to run the "aws-node-fetch-file-and-store-in-s3" example. I have not modified the code. Here is how I am invoking it.

serverless invoke -f save -l -d "{'image_url':'https://assets-cdn.github.com/images/modules/open_graph/github-mark.png','key':'github.png'}"

I am getting the following error message.

{
    "errorMessage": "Parameter 'url' must be a string, not undefined",
    "errorType": "TypeError",
    "stackTrace": [
        "Url.parse (url.js:90:11)",
        "urlParse (url.js:84:5)",
        "Body.Request (/var/task/node_modules/node-fetch/lib/request.js:27:16)",
        "/var/task/node_modules/node-fetch/index.js:51:17",
        "new Fetch (/var/task/node_modules/node-fetch/index.js:49:9)",
        "Fetch (/var/task/node_modules/node-fetch/index.js:37:10)",
        "module.exports.save.fetch.then.then.response.then.buffer.then (/var/task/handler.
js:9:3)"
    ]
}

I guess I am doing a silly error, but I am not able to get rid of it. Please help.

Thanks in advance.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the example's handler.js, which appears in the stack trace, and compare the save function's expected event fields with the payload passed to serverless invoke. Reproduce the command against the aws-node-fetch-file-and-store-in-s3 example; done means the URL and key are received and the invocation completes without the undefined-url error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cloud
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.