Giter Site home page Giter Site logo

metalsmith-s3's People

Contributors

andrew-dixon avatar eyepulp avatar mwishek avatar rasendubi avatar ykarikos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

metalsmith-s3's Issues

TypeError: Error: InvalidParameterType: Expected params.ContentType to be a string

@mwishek - I'm getting the error:

TypeError: Error: InvalidParameterType: Expected params.ContentType to be a string

When attempting to use the plugin. I've tried setting the credentials using export and the config file but doesn't make any difference. My build file looks like this:

var metalsmith    = require('metalsmith');
var markdown      = require('metalsmith-markdown');
var layouts       = require('metalsmith-layouts');
var less          = require('metalsmith-less')
var htmlMinifier  = require("metalsmith-html-minifier");
var uglify        = require('metalsmith-uglify');
var s3            = require('metalsmith-s3');

metalsmith(__dirname)
  .use(markdown())
  .use(layouts({
      'engine': 'handlebars',
      'partials': 'partials'
  }))
  .use(less({
    'pattern': 'less/styles.less'
  }))
  .use(htmlMinifier())
  .use(uglify({
    'removeOriginal': true,
    'order': ['js/jquery.js','js/*.js'],
    'concat': 'js/scripts.min.js'
  }))
 .use(s3({
    action: 'write',
    bucket: 'my-s3-bucket',
    region: 'eu-west-1'
  }))
  .build(function(err) {
    if (err) throw err;
  });

The full error message is:

/Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/node_modules/aws-sdk/lib/request.js:30
            throw err;
            ^

TypeError: Error: InvalidParameterType: Expected params.ContentType to be a string
    at result (/Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/lib/index.js:206:11)
    at /Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/lib/index.js:134:6
    at /Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/lib/index.js:200:5
    at done (/Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/node_modules/async/lib/async.js:126:15)
    at Response.<anonymous> (/Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/node_modules/async/lib/async.js:32:16)
    at Request.<anonymous> (/Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/node_modules/aws-sdk/lib/request.js:354:18)
    at Request.callListeners (/Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
    at Request.emit (/Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/node_modules/aws-sdk/lib/request.js:596:14)
    at Request.transition (/Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/node_modules/aws-sdk/lib/request.js:21:10)
    at AcceptorStateMachine.runTo (/Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/node_modules/aws-sdk/lib/request.js:37:9)
    at Request.<anonymous> (/Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/node_modules/aws-sdk/lib/request.js:598:12)
    at Request.callListeners (/Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
    at Request.emit (/Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/node_modules/aws-sdk/lib/request.js:596:14)
    at Request.transition (/Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/node_modules/aws-sdk/lib/request.js:21:10)
    at AcceptorStateMachine.runTo (/Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/node_modules/aws-sdk/lib/request.js:34:11)
    at Request.<anonymous> (/Library/WebServer/Documents/metalsmith-site/node_modules/metalsmith-s3/node_modules/aws-sdk/lib/request.js:598:12)

Thanks.

Region error despite specifying region

In the S3 online interface, my region is listed as "Oregon", which is us-west-2

My config is

{
  action: 'write',
  bucket: 'actualbucketname',
  region: 'us-west-2'
}

yet I still get the error TypeError: Error: PermanentRedirect: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.

"copy" operation only copies files in destination bucket

I was trying to figure out why none of my images were being copied as part of my metalsmith setup. I think I've tracked it down to the fact that the CopyS3Objects() function executes:
s3.listObjects(param, next);

But param.Bucket is set to config['bucket'], so it's going to read the list of files to copy from the DESTINATION bucket.

Modifying the line to read s3.listObjects({Bucket: config['from']}, next); gives me the desired behaviour.

Is this my misunderstanding of what the intended functionality is, or is it a bug?

"Error: Callback was already called." exception every deployment

Everytime I deploy my static site I get this exception at the end of the copy...

I'm using node 8.4.0 and aws-sdk 2.109.0.

/Users/nicolas/projects/createu.rs/node_modules/aws-sdk/lib/request.js:31
            throw err;
            ^

Error: Callback was already called.
    at Response.<anonymous> (/Users/nicolas/projects/createu.rs/node_modules/metalsmith-s3/node_modules/async/dist/async.js:903:32)
    at Request.<anonymous> (/Users/nicolas/projects/createu.rs/node_modules/aws-sdk/lib/request.js:364:18)
    at Request.callListeners (/Users/nicolas/projects/createu.rs/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
    at Request.emit (/Users/nicolas/projects/createu.rs/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/Users/nicolas/projects/createu.rs/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/Users/nicolas/projects/createu.rs/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/nicolas/projects/createu.rs/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/nicolas/projects/createu.rs/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/nicolas/projects/createu.rs/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/nicolas/projects/createu.rs/node_modules/aws-sdk/lib/request.js:685:12)
    at Request.callListeners (/Users/nicolas/projects/createu.rs/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
    at Request.emit (/Users/nicolas/projects/createu.rs/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/Users/nicolas/projects/createu.rs/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/Users/nicolas/projects/createu.rs/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/nicolas/projects/createu.rs/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/nicolas/projects/createu.rs/node_modules/aws-sdk/lib/state_machine.js:26:10
make: *** [build] Error 1

Write generates bad paths when run from Windows

When a write operation is run on a Windows machine, it copies all of the files in sub directories to the root of the S3 bucket with backslashes in their name. For example if you are writing a file that has the Windows path:

\api\index.html

You would end up with a file in the root of your s3 bucket named literally "\api\index.html" including the backslashes in the filename.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.