I am contributing to the medusa-aith-plugins repo by adding a new auth provider (Keycloak) but I get the above error when testing.
Does anyone know what the error means and how to debug it ? Console.logs / breakpoints don't work. PR and link to repo (https://github.com/adrien2p/medusa-plugins/pull/65 and https://github.com/ianchikwature/medusa-plugins/tree/keycloak)
#{"exists": false} after adding a new auth plugin in medusa-plugins.
23 messages · Page 1 of 1 (latest)
Bey @solid fern , first of all thanks a lot for this contribution 😍
Could you tell me which version of medusa your are using to test?
thanks and I am using 1.7.14.
You have to move to 1.7.6+ otherwise the passport version miss match and therefore there is 2 different passport and the strategies does not get registered in the one used by medusa
Oups sorry i miss read 😂
I can see that you linked the package. Have you started using a custom entry point in order to be able to use —preserve-symlinks? Otherwise you don’t use the right package but the dev deps installed in your local package.
If you want to avoid the step above, you can pack the lib and install it
@deft zephyr I tried packing it like you suggested, moved the tgz into a tmp folder in my medusa dir, it installed without any issues but I still get the same error "exists:false" even for google which I didn't touch.
How did you configured it in your medusa-config?
This is how I configured it. I have also attached the full file
Your authPath and authCallbackPath are the same for google and keycloak. One will override the other one. Could you change that?
Also, once you ve changed that, could you tell me if in your node_modules/medusa-plugin-auth/node_modules there is a passport package. It should not be present but I just want to be sure
@deft zephyr Fixed that issue no change and strange, passport isn't in the node_modules
This is normal that it is not in the node module. It is a peer deps,
Also don’t forget to fix your config 👍
I fixed the config (authPath and authCallbackPath), I still get the same issue
That sounds very strange, we might need to pass in debug mode. Can you put a breakpoint or log in this file https://github.com/adrien2p/medusa-plugins/blob/main/packages/medusa-plugin-auth/src/loaders/index.ts and see that you reach the end?
@deft zephyr I think I found the issue, it's failing here https://github.com/adrien2p/medusa-plugins/blob/main/packages/medusa-plugin-auth/src/loaders/index.ts#L4 , it errors saying it can't find dist/loaders . Here's the error, I think require("../auth-strategies/google") points it to dist/loaders instead. Any ideas ?
Nothing in the strategy is pointing toward the loaders 🤔
When you go to the next bp what do you get?
It fails with this (screenshot attached) because it can't find it. There is a warning in the process console, it says Running loader failed: Class extends value undefined is not a constructor or null
this is where it fails
I can't see the errors entirely in the screen shots