Comments (7)
After double checking the docs from serverless-offline, the first issue is expected. Just poorly documented.
To use serverless offline with any other plugin, you nee to use the start
command so it fires the lifecycle events (see https://github.com/dherault/serverless-offline#usage-with-serverless-dynamodb-local-and-serverless-webpack-plugin)
The second issue still needs to be resolved.
from serverless-middleware.
Awesome thanks!
This should be fixed in version 0.0.12
Let me know if you find anything else 🙂
from serverless-middleware.
Hi @xaeli
whenever I try to run the command serverless offline it would throw an error regarding the handler being an array, when this should be normal when using middlewares
Are you declaring the middleware
plugin before the offline
plugin? That is necessary for list of middlewares to be converted into a single handler which is use by serverless offline.
I will review the lifecycle events anyway.
followed the previous steps, now whenever I try to cancel the process in git bash or powershell I got the error:
Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\ ... .middleware'
I've never seen this. I'll need to check.
Could you share the versions of serverless and the plugins which you are using?
from serverless-middleware.
The second issue means that the .middleware
folder is not being created.
If you are not getting errors, it probably wasn't needed which can happen if there are no functions actually using middlewares i.e. the functions only have a single handler and there is no global pre or pos middlewares.
I'm pushing a fix for this.
If you can think of anything else, please let me know
from serverless-middleware.
Hi @juanjoDiaz thanks for the quick reply
the versions I'm using:
- serverless-middleware: 0.0.11
- serverless-offline: ^5.12.0
reggarding the second issue, I think it's the opposite, first cause I can actually see that the .middleware
folder was created, but it will not delete (cleanup) when I tried to finish the process (maybe there is something with R/W permissions but I'm on windows so it shouldn't be a matter)
reggarding no functions using middleware, I had one using it (as I said I was just testing so I put a middleware just to try and this happened), so currently the .middleware
folder it's just hanging around non removed
Also, terrific work with this middleware, I used it for a previous project a while ago and solved a lot of issues 👍
from serverless-middleware.
Glad that you are finding this plugin useful! 🙂
Saw that you put a message saying that this was fixed but then removed it.
What is the status on this?
Could you share a repo that I can use to replicate the issue?
from serverless-middleware.
Yeah, the problem persist, I just created this repo to replicate the error
https://github.com/xaeli/middleware-test
from serverless-middleware.
Related Issues (20)
- conflict with serverless-plugin-warmup plugin HOT 2
- Serverless stops working after adding middleware (only in production) HOT 10
- Doesn't work with Serverless v3 HOT 3
- v1.0.0 with Serverless V3 throws error on deploy HOT 2
- Cannot do dynamic imports when using a middleware HOT 3
- Allow `nodejs16.x` HOT 1
- serverless-typescript or serverless-esbuild HOT 2
- Path of .middleware folder when searching for modules is broken with default folderName in Serverless 3.0 HOT 4
- Middleware only runs on HTTP API HOT 2
- ERR_MODULE_NOT_FOUND when using Typescript and targeting ES6 or higher HOT 2
- Issue with lambda callbacks HOT 3
- ERR_MODULE_NOT_FOUND using serverless-offline HOT 3
- Middleware function not invoked HOT 1
- Which version of the plugin serverless-middleware supports function level middleware and whats the syntax HOT 1
- not working since 3.2.0 HOT 5
- serverless-middleware incompatibility with serverless-webpack HOT 4
- Get underlying exception object on pos-catch middleware HOT 2
- I can't setup serverless middleware HOT 1
- other lambda functions are in .middleware. HOT 1
- Support for ECR images
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-middleware.