Skip to content
This repository was archived by the owner on Mar 27, 2020. It is now read-only.
This repository was archived by the owner on Mar 27, 2020. It is now read-only.

IOpipe layer not being added when installed with webpack plugin #41

Description

@austinhuminski

Install not working when using the example in this repo with serverless-webpack. No layers or IOpipe environment variables get added to the function. When invoking, the "No Plugins" error message returns denoting that it could not find the iopipe wrapper in the context of the invocation

Austins-MacBook-Pro:serverless-webpack austinhuminski$ sls invoke -f handler
{
    "errorType": "Error",
    "errorMessage": "No plugins",
    "trace": [
        "Error: No plugins",
        "    at Runtime.e.exports.handler (/var/task/handler.js:1:1037)",
        "    at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)",
        "    at process._tickCallback (internal/process/next_tick.js:68:7)"
    ]
}

Tried to alter webpack config and manually add in iopipe-wrapper.js files:

iopipe-handler.js

module.exports = require('@iopipe/iopipe');

webpack.config.js

const slsw = require("serverless-webpack");
const CopyWebpackPlugin = require('copy-webpack-plugin');

module.exports = {
  entry: slsw.lib.entries,
  target: "node",
  plugins: [
        new CopyWebpackPlugin([
            {
                from: './iopipe-wrapper.js',
                to: './',
            },
        ]),
    ],
};

Versions

"dependencies": {
  "serverless": "^1.51.0",
  "serverless-iopipe-layers": "^0.4.0",
  "serverless-webpack": "^5.2.0",
  "webpack": "^4.39.3"
},
"devDependencies": {
  "copy-webpack-plugin": "^5.0.4"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions