Comments (7)
Hmm that is weird. What version of serverless are you using?
from serverless-nodejs-starter.
You've left out webpack
in your command.
e.g. you need to run serverless webpack invoke local --function hello
from serverless-nodejs-starter.
@andrewoh531 when I run serverless webpack invoke local --function hello
I get Command "webpack invoke local" not found, Run "serverless
so that does not work.
@jayair I'm using serverless version 1.8.0
from serverless-nodejs-starter.
@newbreedofgeek Can I see the full error?
from serverless-nodejs-starter.
@jayair there is not much error detail, when I run serverless webpack invoke local --function hello
I get:
Serverless Error ---------------------------------------
Command "webpack invoke local" not found, Run "serverless
help" for a list of all available commands.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Your Environment Information -----------------------------
OS: darwin
Node Version: 6.10.3
Serverless Version: 1.8.0
I have not made any changes after I cloned this project, I just clones it, ran npm install
and then ran the above command. If I run serverless webpack invoke --function hello
it works, but local
does not work.
Actually what is the difference between the invoke
and invoke local
from serverless-nodejs-starter.
Hi @newbreedofgeek, sorry for the confusion. Let me explain what the following commands do:
serverless invoke
serverless invoke local
serverless webpack invoke
The first 2 are built-in commands of Serverless Framework. The former serverless invoke
runs your Lambda function remotely and serverless invoke local
runs it locally.
(function (exports, require, module, __filename, __dirname) { export const hello = async (event, context, callback) => {
^^^^^^
SyntaxError: Unexpected token export....
.....
The reason you got the above error earlier when you ran serverless invoke local --function hello
was because Serverless Framework tried to run your Lambda function in es7 syntax without transpiling first. This is the expected behavior.
The tutorial uses this Serverless Framework plugin, serverless-webpack to handle transpile. The third command serverless webpack invoke
is added on by the plugin. It will transpile the Lambda function, then invoke it locally. And serverless webpack invoke local
is not a valid command.
from serverless-nodejs-starter.
@fwang great! tnx :)
from serverless-nodejs-starter.
Related Issues (20)
- Feature request: SAM template HOT 1
- Babel 7 support HOT 1
- Error message when installing dependencies HOT 5
- Any future updates to this repo - like updating to Node 10.x HOT 3
- Error: Can't resolve 'source-map-support/register' in 'libs/response-lib.js' HOT 17
- AWS_PROFILE=default serverless invoke local --function create --path mocks/create-event.json HOT 1
- Function Routes Defined in file not loaded HOT 2
- Clean install with deploy results in non-webpacked node functions HOT 1
- Debug lambda using VScode
- Tests do not load .env or serverless.yml variables HOT 8
- Can't create a project on Windows 10 - Request timed out HOT 1
- Cannot run sample project on aws lambda HOT 1
- Sharp module not found after deploy HOT 2
- Create Ticket - Instructor HOT 1
- Initial install throws serverless DeprecationWarning DEP0066
- Build crashes when using email-templates HOT 3
- Typescript version of the repo HOT 2
- gyp verb `which` failed Error: not found: python2 HOT 16
- As per Indian regulations, only registered Indian businesses (i.e. sole proprietorships, limited liability partnerships and companies, but not individuals) can accept international payments. More info here: https://stripe.com/docs/india-exports\" error.
- Serverless: Operation failed!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serverless-nodejs-starter.