Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3.0.0 #175

Merged
merged 31 commits into from
Aug 17, 2017
Merged

V3.0.0 #175

merged 31 commits into from
Aug 17, 2017

Conversation

HyperBrain
Copy link
Member

@HyperBrain HyperBrain commented Jul 28, 2017

What did you implement:

This PR merges the v3.0.0 branch to master as soon as it is stabilized.
Feel free to test this branch - this will help to make sure that it works properly.

As soon as all features have been merged, the V3.0.0 branch will be published as prerelease for testing.

Closes #181
Closes #120
Closes #173
Closes #117
Closes #116
Closes #108
Relates to #60

Closes #151
Closes #152

Contained PRs

#161 , #153 , #177

Frank Schmid and others added 11 commits August 1, 2017 21:56
* Make processed input path absolute

When using the invoke local command with the --path (-p) flag, relative file paths will not be found because serverless will end up looking in the build directory later on. So, this commit ensures that the path is absolute, ensuring it will be found, even if the path was relative.

Couldn't think of a good name for the function. Also, I'm not sure that this should go in the utils file.

Happy to make revisions!

* Move execution building out of utils

* Add lib/makePathOptionAbsolute.js
@cwaltken-edrans
Copy link

Hi Frank,
i just tried out v3.0.0 with my project without success and the following error:

{ Error: Cannot find module '/<project_path_redacted>/.webpack/handler'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at AwsInvokeLocal.invokeLocalNodeJs (/usr/lib/node_modules/serverless/lib/plugins/aws/invokeLocal/index.js:156:33)
    at AwsInvokeLocal.invokeLocal (/usr/lib/node_modules/serverless/lib/plugins/aws/invokeLocal/index.js:114:19)
    at AwsInvokeLocal.tryCatcher (/usr/lib/node_modules/serverless/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/usr/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/usr/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/usr/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/usr/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:693:18)
    at Async._drainQueue (/usr/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/usr/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/usr/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5) code: 'MODULE_NOT_FOUND'
}

My webpack.conf.js looks like this:

module.exports = {
  entry: './handler.js',
  target: 'node',
  module: {
    loaders: [{
      test: /\.js$/,
      loaders: ['babel-loader'],
      include: __dirname,
      exclude: /node_modules/,
    },
    {
      test: /\.json$/,
      loader: 'json-loader'
    },
    {
      test: /\.yaml$/,
      loader: "file-loader"
    }]
  },
};

Note that the same project works with v2.2.0 and webpack invoke.
I tried v3.0.0. because I need the new generalized invoke local function.
It seems to me v2.2.0 has a bug if you add static files with the webpack file-loader, since webpack invoke does not have the bundled file in the execution path.

I'm looking forward to v3.0.0!
Regards
Clemens

@HyperBrain
Copy link
Member Author

HyperBrain commented Aug 3, 2017

@cwaltken-edrans Hi Clemens,

Thanks for giving the v3 a try 👍

I had the issue just today too, and already fixed it in the v3.0.0-individual-packaging branch.
Could you check with that branch and let me know if it is also fixed for you?

That branch will be merged soon to v3.0.0 and is currently rebased, so it reflects the most current v3 version.

BTW: You should use dynamic entries in your webpack.conf - simplifies configuration ;-):

const slsw = require('serverless-webpack');
module.exports = {
  entry: slsw.lib.entries,
  target: 'node',
  module: {
    loaders: [{
      test: /\.js$/,
      loaders: ['babel-loader'],
      include: __dirname,
      exclude: /node_modules/,
    },
    {
      test: /\.json$/,
      loader: 'json-loader'
    },
    {
      test: /\.yaml$/,
      loader: "file-loader"
    }]
  },
};

@cwaltken-edrans
Copy link

cwaltken-edrans commented Aug 3, 2017

P.S:: Using automatic entry resolution as described in the docs or exporting the module I get a type error from serverless:

  Type Error ---------------------------------------------
 
  lambda is not a function
 
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Forums:        forum.serverless.com
     Chat:          gitter.im/serverless/serverless
 
  Your Environment Information -----------------------------
     OS:                     linux
     Node Version:           6.11.1
     Serverless Version:     1.18.0

I'll try out the new branch now.

@HyperBrain
Copy link
Member Author

That is strange. Can you put a simple sample project somewhere (maybe gist or github) with that the dynamic entry issue is reproducible?

@HyperBrain
Copy link
Member Author

@cwaltken-edrans If you encounter something that's not working you can open an issue (just prefix it with V3:). Then we can try to solve them individually 😃 .

HyperBrain and others added 3 commits August 5, 2017 12:55
Support individual packaging with multi-compile
* Change CWD before local invoke and restore it afterwards

* Adapted unit tests

* Renamed module
@HyperBrain HyperBrain merged commit 85560af into master Aug 17, 2017
@HyperBrain HyperBrain deleted the v3.0.0 branch August 17, 2017 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants