amazon-archives/serverless-image-resizing

help,there is throw a mistake.

hare2011 opened this issue · 14 comments

2017-03-31T07:41:10.167Z 6835cdb1-15e5-11e7-ae5d-7dd945e4dd5c TypeError: Cannot read property 'key' of undefined
at exports.handler.S3.getObject.promise.then.then (/var/task/index.js:9:40)

Same problem! Have no idea what is going wrong.

Hmm - are you running it through an API Gateway Lambda proxy? It appears like the query string parameters are not defined.

In my case i made a mistake setting URL environment variable. So setting url from endpoint static website hosting of my bucket fixed problem.

@imamatory Glad you figured it out! @hare2011 Please let me know a little more about how you're running the function and definitely double check your environment variables.

there is my config
f5d35afb-9c6d-4ee8-8da4-4417a8f7b374

@hare2011 When I hit your endpoint, it appears to be working for me. Hitting:

http://images-vamily.s3.amazonaws.com/

I can see an index of all images in your bucket. When I hit them, I can resize them. See:

http://images-vamily.s3-website-us-west-2.amazonaws.com/500x500/4.jpg
http://images-vamily.s3-website-us-west-2.amazonaws.com/300x300/4.jpg

great. thank you much very.

Because the x in there is some Unicode "x" and not an actual ASCII x as the sample code is attempting to match via a regular expression. See:

http://images-vamily.s3-website-us-west-2.amazonaws.com/300x300/5.png

so bad . i copy the 'x' from the web page. @jpignata thank you for you help.

there is problem for me .i watch the lambda log .i access the images .the log will add record.
5f1ad816-0387-49c5-a8df-239902a754ad

@hare2011 Sorry, I don't follow.