Skip to content

aws-node-single-page-app-via-cloudfront - syncToS3 error  #384

@thehme

Description

@thehme

Hi there, looking at this example and it fails to sync with S3 with command serverless syncToS3. I get:

  Cannot read property 'toString' of 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:           10.15.1
     Serverless Version:     1.40.0

Any idea why this happens?

Followed the message instructions, and set SLS_DEBUG=*, which yields the following messages:

...
Serverless: Invoke syncToS3

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

  Cannot read property 'toString' of null

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

  Stack Trace --------------------------------------------

TypeError: Cannot read property 'toString' of null
    at ServerlessPlugin.runAwsCommand (/Users/aws-node-single-page-app-via-cloudfront/serverless-single-page-app-plugin/index.js:41:34)
    at ServerlessPlugin.syncDirectory (/Users/aws-node-single-page-app-via-cloudfront/serverless-single-page-app-plugin/index.js:63:28)
    at BbPromise.reduce (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:408:55)
From previous event:
    at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:408:22)
    at PluginManager.run (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:439:17)
    at variables.populateService.then (/usr/local/lib/node_modules/serverless/lib/Serverless.js:109:33)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
    at process.topLevelDomainCallback (domain.js:120:23)
From previous event:
    at Serverless.run (/usr/local/lib/node_modules/serverless/lib/Serverless.js:96:6)
    at serverless.init.then (/usr/local/lib/node_modules/serverless/bin/serverless:43:28)
    at /usr/local/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:111:16
    at /usr/local/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:45:10
    at FSReqWrap.oncomplete (fs.js:141:20)
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions