Skip to content
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

Cannot find names ['LambdaHTTPEvent', 'DynamoDBItem'] during deployment #6

Open
mcat-ee opened this issue Feb 26, 2018 · 4 comments
Open

Comments

@mcat-ee
Copy link

mcat-ee commented Feb 26, 2018

I'm getting the following issues during deployment:

$ serverless deploy
Serverless: Configure DynamoDB Auto Scaling …
Serverless:  - Building configuration for resource "table/DynamoDBTable"
Serverless: Added DynamoDB Auto Scaling to CloudFormation!
Serverless: Compiling with Typescript...
Serverless: Using local tsconfig.json
src/api/ranking.ts (5,24): Cannot find name 'LambdaHttpEvent'.
src/api/ranking.ts (27,12): Cannot find name 'DynamoDBItem'.
src/api/ranking.ts (28,11): Cannot find name 'DynamoDBItem'.
src/api/ranking.ts (28,28): Cannot find name 'DynamoDBItem'.
src/api/ranking.ts (31,12): Cannot find name 'DynamoDBItem'.
src/api/ranking.ts (32,14): Cannot find name 'DynamoDBItem'.
src/api/ranking.ts (39,12): Cannot find name 'RankingItem'.
src/api/series.ts (6,24): Cannot find name 'LambdaHttpEvent'.
src/api/series.ts (33,12): Cannot find name 'DynamoDBItem'.
src/api/series.ts (34,11): Cannot find name 'DynamoDBItem'.
src/api/series.ts (34,28): Cannot find name 'DynamoDBItem'.
src/api/series.ts (37,12): Cannot find name 'DynamoDBItem'.
src/api/series.ts (38,14): Cannot find name 'DynamoDBItem'.
src/api/series.ts (45,12): Cannot find name 'SeriesItem'.
src/process.ts (31,23): Cannot find name 'EventData'.
src/process.ts (56,28): Cannot find name 'KinesisEvent'.
src/process.ts (61,12): Cannot find name 'KinesisItem'.
Serverless: Packaging service...
Serverless: Excluding development dependencies...

I had some earlier issues with Brew and jq (Brew was an older version and jq wasn't installed) - but they appear to be sorted now.

I changed the service name and tried to re-deploy but I received the same errors :(

What should I try next?

edit: I'm running OSX 13.3

I've ran the commands included in the README.md file and npm install

@artoliukkonen
Copy link
Contributor

Those are just typescript warnings for missing typings, it doesn't affect the actual build.

I just did a clean run on OSX, seems like there's some things that are not documented.

  • deploy script is using library called jq. You can install it by running brew install jq (if you have Homebrew installed) or download it here https://stedolan.github.io/jq/download/
  • That same script is using s3sync-cli to upload files to S3. That tool requires AWS_ACCESS_KEY and AWS_SECRET_KEY environmental variables to be set.

After these changes I got this project app deployed.

@artoliukkonen
Copy link
Contributor

One more thing; analytics dashboard example is hardcoded to load analytics from 2017. That's why you probably see empty analytics unless you fix that manually.

@mcat-ee
Copy link
Author

mcat-ee commented Feb 27, 2018

Okay I've installed s3sync-cli and set my AWS credentials... but now i'm getting the following errors:

opts:	".serverless/output.json"
output:	"dist/website/index.html"
opts:	".serverless/output.json"
output:	"dist/dashboard/index.html"

Sync `dist` folder with S3 …

index.html -> https://s3.amazonaws.com/************/index.html
Error: Bad status code: 307
    at /Users/****/serverless-analytics/node_modules/s3-sync/index.js:129:17
    at wrappedFn (/Users/***/serverless-analytics/node_modules/knox/lib/client.js:409:9)
    at ClientRequest.onResponse (/Users/****/serverless-analytics/node_modules/knox/lib/client.js:60:7)
    at emitOne (events.js:115:13)
    at ClientRequest.emit (events.js:210:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:565:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:116:23)
    at TLSSocket.socketOnData (_http_client.js:454:20)
    at emitOne (events.js:115:13)
    at TLSSocket.emit (events.js:210:7)
index.html -> https://s3.amazonaws.com/*****************/index.html
Error: Bad status code: 307
    at /Users/***/serverless-analytics/node_modules/s3-sync/index.js:129:17
    at wrappedFn (/Users/****/serverless-analytics/node_modules/knox/lib/client.js:409:9)
    at ClientRequest.onResponse (/Users/****/serverless-analytics/node_modules/knox/lib/client.js:60:7)
    at emitOne (events.js:115:13)
    at ClientRequest.emit (events.js:210:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:565:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:116:23)
    at TLSSocket.socketOnData (_http_client.js:454:20)
    at emitOne (events.js:115:13)
    at TLSSocket.emit (events.js:210:7)

Dashboard: http://**********.s3-website-ap-southeast-2.amazonaws.com/
Website: http://************.s3-website-ap-southeast-2.amazonaws.com/

and when I navigate to the site I get this:
image

I'll investigate properly after work but any further help you can provide would be excellent.

Thank you so much for your help thus far!!!!!!

@issnoe
Copy link

issnoe commented Feb 14, 2019

Okay I've installed s3sync-cli and set my AWS credentials... but now i'm getting the following errors:

opts:	".serverless/output.json"
output:	"dist/website/index.html"
opts:	".serverless/output.json"
output:	"dist/dashboard/index.html"

Sync `dist` folder with S3 …

index.html -> https://s3.amazonaws.com/************/index.html
Error: Bad status code: 307
    at /Users/****/serverless-analytics/node_modules/s3-sync/index.js:129:17
    at wrappedFn (/Users/***/serverless-analytics/node_modules/knox/lib/client.js:409:9)
    at ClientRequest.onResponse (/Users/****/serverless-analytics/node_modules/knox/lib/client.js:60:7)
    at emitOne (events.js:115:13)
    at ClientRequest.emit (events.js:210:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:565:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:116:23)
    at TLSSocket.socketOnData (_http_client.js:454:20)
    at emitOne (events.js:115:13)
    at TLSSocket.emit (events.js:210:7)
index.html -> https://s3.amazonaws.com/*****************/index.html
Error: Bad status code: 307
    at /Users/***/serverless-analytics/node_modules/s3-sync/index.js:129:17
    at wrappedFn (/Users/****/serverless-analytics/node_modules/knox/lib/client.js:409:9)
    at ClientRequest.onResponse (/Users/****/serverless-analytics/node_modules/knox/lib/client.js:60:7)
    at emitOne (events.js:115:13)
    at ClientRequest.emit (events.js:210:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:565:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:116:23)
    at TLSSocket.socketOnData (_http_client.js:454:20)
    at emitOne (events.js:115:13)
    at TLSSocket.emit (events.js:210:7)

Dashboard: http://**********.s3-website-ap-southeast-2.amazonaws.com/
Website: http://************.s3-website-ap-southeast-2.amazonaws.com/

and when I navigate to the site I get this:
image

I'll investigate properly after work but any further help you can provide would be excellent.

Thank you so much for your help thus far!!!!!!

open html files in local to test, its work , try to change de client side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants