grunt-cloudfront icon indicating copy to clipboard operation
grunt-cloudfront copied to clipboard

Fatal error: Cannot read property 'length' of null

Open roubenz opened this issue 10 years ago • 6 comments

I'm getting this error:

Fatal error: Cannot read property 'length' of null

Actually it says:

Invalidation succeeded. Please wait a few minutes.OK
{ 
Location: 'https://cloudfront.amazonaws.com/',
Id: ''
/** normal account data */
}
Fatal error: Cannot read property 'length' of null

I've checked from aws console, it is actually creating invalidation rule, but is not waiting for it to be completed.

roubenz avatar Aug 10 '15 04:08 roubenz

Also, this code block:

process.on('SIGINT', function() {
});

prevents grunt watch to be properly terminated by ctrl+C. It says Cannot read property writeln of undefined.

roubenz avatar Aug 10 '15 08:08 roubenz

I'm also experiencing the same issue.

ianpogi5 avatar Oct 12 '15 05:10 ianpogi5

I'm seeing this issue as well.

Somehow it makes grunt-watch unable to terminate (As stated above) --this looks like a separate issue.

matthewadowns avatar Oct 16 '15 19:10 matthewadowns

Note: setting options.listInvalidations: false fixes the issue. Looks like it's having trouble listing the invalidations.

matthewadowns avatar Oct 16 '15 19:10 matthewadowns

I hit this same issue. The solution was to update package.json dependency for aws-sdk so it could get the latest version. Currently, the dependency is v1.x and aws-sdk is now on v2.x.

I'll submit a PR for this, as I'd prefer to keep using an existing NPM module vs. forking it and publishing a new one for such a minor change.

dsquier avatar Jan 21 '16 19:01 dsquier

Thank you @dsquier for the PR. Sorry it took so long for me to merge it, I don't use it anymore at work so hard to find time. I just merged the fix, and published to npm under version 0.2.2. Hope that fixes it for everyone.

flrent avatar Feb 29 '16 21:02 flrent