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

gzip option breaks s3 task with warning #119

Closed
louisremi opened this issue Jan 31, 2014 · 1 comment
Closed

gzip option breaks s3 task with warning #119

louisremi opened this issue Jan 31, 2014 · 1 comment

Comments

@louisremi
Copy link
Contributor

Hi, there must something wrong with my config because I can't get the gzip option to work. Without it , the following config works fine

        s3: {
            options: {
                key: '<%= aws.key %>',
                secret: '<%= aws.secret %>',
                bucket: '<%= aws.bucket %>',
                access: 'public-read'
            },
            // _typeface isn't revved yet, so don't cache it.
            // I don't think index.html should be cached.
            dev: {
                upload: [{
                    src: '<%= yeoman.dist %>/_typeface/**/**/*',
                    rel: '<%= yeoman.dist %>/',
                    dest: ''
                }, {
                    src: '<%= yeoman.dist %>/*.html',
                    rel: '<%= yeoman.dist %>/',
                    dest: '',
                    //options: { gzip: true }
                }, {
                    src: '<%= yeoman.dist %>/scripts/*',
                    rel: '<%= yeoman.dist %>/',
                    dest: '',
                    options: {
                        //gzip: true,
                        headers: {
                            // Two Year cache policy (1000 * 60 * 60 * 24 * 730)
                            'Cache-Control': 'max-age=630720000, public',
                            'Expires': new Date(Date.now() + 63072000000).toUTCString(),
                        }
                    }
                }, {
                    src: '<%= yeoman.dist %>/styles/*',
                    rel: '<%= yeoman.dist %>/',
                    dest: '',
                    options: {
                        //gzip: true,
                        headers: {
                            // Two Year cache policy (1000 * 60 * 60 * 24 * 730)
                            'Cache-Control': 'max-age=630720000, public',
                            'Expires': new Date(Date.now() + 63072000000).toUTCString(),
                        }
                    }
                }, {
                    src: '<%= yeoman.dist %>/favicon.ico',
                    dest: 'favicon.ico',
                    options: { headers: {
                        // One week cache policy (1000 * 60 * 60 * 24 * 7)
                        'Cache-Control': 'max-age=604800000, public',
                        'Expires': new Date(Date.now() + 604800000).toUTCString(),
                    }}
                }, {
                    src: '<%= yeoman.dist %>/robots.txt',
                    dest: 'robots.txt'
                }]
            }
        }

But when I uncomment any of the gzip options, grunt s3 --stack returns the following error:

Running "s3:dev" (s3) task
Warning: Cannot define property:4, object is not extensible. Use --force to continue.
TypeError: Cannot define property:4, object is not extensible.
    at normalize (/home/louisremi/Workspace/prototyp0/node_modules/grunt-s3/node_modules/temporary/lib/detector.js:23:34)
    at Object.detector.tmp (/home/louisremi/Workspace/prototyp0/node_modules/grunt-s3/node_modules/temporary/lib/detector.js:43:10)
    at Object.generator.build (/home/louisremi/Workspace/prototyp0/node_modules/grunt-s3/node_modules/temporary/lib/generator.js:45:27)
    at File.Base.init (/home/louisremi/Workspace/prototyp0/node_modules/grunt-s3/node_modules/temporary/lib/base.js:31:28)
    at new File (/home/louisremi/Workspace/prototyp0/node_modules/grunt-s3/node_modules/temporary/lib/file.js:23:8)
    at Object.exports.put.exports.upload (/home/louisremi/Workspace/prototyp0/node_modules/grunt-s3/tasks/lib/s3.js:183:17)
    at /home/louisremi/Workspace/prototyp0/node_modules/grunt-s3/tasks/lib/S3Task.js:61:22
    at /home/louisremi/Workspace/prototyp0/node_modules/grunt/node_modules/async/lib/async.js:86:13
    at Array.forEach (native)
    at _forEach (/home/louisremi/Workspace/prototyp0/node_modules/grunt/node_modules/async/lib/async.js:26:24)

Aborted due to warnings.

I'm using 0.2.0-alpha.3

@louisremi
Copy link
Contributor Author

Apparently the version of the "temporary" package used in grunt-s3 has incompatibility issues with recent versions of node.js. Updating to temporary 0.0.8 fixed my problem.

pifantastic added a commit that referenced this issue Feb 5, 2014
fix #119 update "temporary" dependency to 0.0.8
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

1 participant