Coder Social home page Coder Social logo

Comments (7)

juanjoDiaz avatar juanjoDiaz commented on August 28, 2024 2

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.

juanjoDiaz avatar juanjoDiaz commented on August 28, 2024 1

Awesome thanks!

This should be fixed in version 0.0.12

Let me know if you find anything else 🙂

from serverless-middleware.

juanjoDiaz avatar juanjoDiaz commented on August 28, 2024

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.

juanjoDiaz avatar juanjoDiaz commented on August 28, 2024

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.

whitte-h avatar whitte-h commented on August 28, 2024

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.

juanjoDiaz avatar juanjoDiaz commented on August 28, 2024

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.

whitte-h avatar whitte-h commented on August 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.