#After update to 2.0.9, custom middlewares doesn't work?
10 messages · Page 1 of 1 (latest)
Ok, problem solved - routes dont work when defineMiddlewares are imported from:
but works when imported from:
did you drop all your node_modules and .lock files before?
that seems like as you have different package versions installed.
Yes, i do that
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
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
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...
Hey @crimson vigil , im so sorry. The problem is with the file name. It should be middlewares.ts but I put it as middleware.ts. Anyway, both imports are working fine which is @medusajs/medusa and @medusajs/framework. But i think we should use @medusajs/medusa right?