#After update to 2.0.9, custom middlewares doesn't work?

10 messages · Page 1 of 1 (latest)

urban current
#

That's seems like middlewares doesn't work and not set a remoteQueryConfig.

#

Ok, problem solved - routes dont work when defineMiddlewares are imported from:

#

but works when imported from:

crimson vigil
#

did you drop all your node_modules and .lock files before?
that seems like as you have different package versions installed.

urban current
#

Yes, i do that

minor rover
#

I know this is old but should we import from that path? "@medusa/medusa/dist/utils/define-middlesware".

Do you think we should import from @medusa/medusa instead, as that is a proper build.

By the way, I think I am having issues with the defineMiddlewares import. I don't think it is registering anything

crimson vigil
#

can you try:
import { defineMiddlewares } from "@medusajs/framework"

minor rover
# crimson vigil can you try: `import { defineMiddlewares } from "@medusajs/framework"`

Hi @crimson vigil ,thanks for the reply. It still doesn't work after importing defineMiddlewares from @medusajs/framework. I raised an issue in Github and pushed a repo on my github in case you wanna have a look at it.

https://github.com/medusajs/medusa/issues/9556
https://github.com/zaidrashid/medusa-playground

GitHub

Bug report Describe the bug Creating a middleware on a custom API route does not seem to work or register. I was following the steps explained here (creating basic API routes) and here (adding midd...

GitHub

Playground for testing MedusaV2. Contribute to zaidrashid/medusa-playground development by creating an account on GitHub.

minor rover