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

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

Open
austinhuminski opened this issue Sep 26, 2019 · 0 comments
Open
Labels
bug Something isn't working

Comments

@austinhuminski
Copy link
Contributor

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"
}
@austinhuminski austinhuminski added the bug Something isn't working label Sep 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant