Open srg-clearlaunch opened 8 years ago
Thanks, still fixing this. Almost done :)
Should be good with #27 :smile:
I get this error just by adding "serverless-optimizer-plugin"
to the plugins array in s-project.json
.
/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:49
fn = function () { throw arg; };
^
TypeError: Class extends value #<Serverless> is not a function or null
at module.exports.ServerlessPlugin.browserify._this.config.requires.map._this.config.plugins.map._this.config.transforms.map._this.config.exclude.forEach._this.config.ignore.forEach._generateIncludePaths (xxxxxx/node_modules/serverless-optimizer-plugin/index.js:21:37)
at Serverless._loadPlugins (/usr/local/lib/node_modules/serverless/lib/Serverless.js:286:25)
at Serverless.loadProjectPlugins (/usr/local/lib/node_modules/serverless/lib/Serverless.js:240:10)
at /usr/local/lib/node_modules/serverless/lib/Serverless.js:77:41
From previous event:
at Serverless.init (/usr/local/lib/node_modules/serverless/lib/Serverless.js:73:25)
at Object.<anonymous> (/usr/local/lib/node_modules/serverless/bin/serverless:17:12)
at Module._compile (module.js:399:26)
at Object.Module._extensions..js (module.js:406:10)
at Module.load (module.js:345:32)
at Function.Module._load (module.js:302:12)
at Function.Module.runMain (module.js:431:10)
at startup (node.js:141:18)
at node.js:977:3
and just running sls
I am getting exactly same error like @purplecones (serverless v0.5.0
)
You should install latest master, install it by adding this to package.json
"serverless-optimizer-plugin": "https://github.com/serverless/serverless-optimizer-plugin.git"
thanks @ajagnanan
Using babelify and trying to run a function, I get the following error:
class ServerlessOptimizer extends S.classes.Plugin {
^
TypeError: Cannot read property 'Plugin' of undefined
at module.exports.S.classes.Plugin.browserify._this.config.requires.map._this.config.plugins.map._this.config.transforms.map._this.config.exclude.forEach (/Users/CP/Development/project/node_modules/serverless-optimizer-plugin/index.js:20:46)
My s-project.json
has this defined:
"custom": {
"serverless-offline": {
"babelOptions": {
"presets": ["es2015"]
}
},
"optimize": {
"exclude": ["aws-sdk"],
"transforms": [
{
"name": "babelify",
"opts": {
"presets": [
"es2015"
]
}
}
]
}
},
"plugins": [
"serverless-optimizer-plugin",
"serverless-offline"
]
My dependencies are:
"dependencies": {
"babel-preset-es2015": "^6.6.0",
"babel-preset-stage-0": "^6.5.0",
"babelify": "^7.2.0",
"serverless-offline": "^2.2.9",
"serverless-optimizer-plugin": "^2.4.0"
}
Any ideas why I would be getting this error?
@patoncrispy you need to specify custom settings in s-function.json
since serverless 0.5.0
.. see issue #30
So should I not have anything in my s-project.json
, @martinmicunda? The docs suggest the following format:
{
"name": "projectName",
"custom": {}, // For plugin authors to add any properties that they need
"plugins": [] // List of plugins used by this project
}
you only move optimize config to s-function.json
and everything else stay in s-project.json
s-function.json
"custom": {
"excludePatterns": [
"node_modules"
],
"optimize": {
"exclude": [
"aws-sdk"
],
"transforms": [
{
"name": "babelify"
}
],
"minify": true
}
},
I'm testing the v0.5 branch for the serverless guys and looks like there is a problem with the optimizer plugin and the new code. I'm able to deploy without issue if serverless-optimizer-plugin is not included in the s-project.json plugins, however once included I get the following: