Skip to main content

How do I deploy a bundle that is using the aws-sdk without error?

Symptoms

  1. Attempting to create a new Content Source that uses aws-sdk.

  2. When I try to deploy that bundle that uses aws-sdk to PageBuilder, an error occurs on the Deployer screen.

    npm exited with code 1

  3. The bundle contains import Aws from 'aws-sdk'; 

Cause

The aws-sdk package is already provided by Fusion, so there is no need to add it.

Solution

You should not install the aws-sdk as a dependency, since it comes already installed on our Lambda instances. If you change it to a peer-dependency, you should still be able to work on your code locally, while not breaking the install when you publish.