#Cannot read properties of undefined (reading 'prototype')

16 messages · Page 1 of 1 (latest)

raw osprey
#

[medusa-config] ⚠️ redis_url not found. A fake redis instance will be used.
info: Using fake Redis
✔ Models initialized – 24ms
✔ Plugin models initialized – 4ms
✔ Strategies initialized – 39ms
⠋ Initializing modules
✔ Modules initialized – 20ms
✔ Database initialized – 599ms
✔ Repositories initialized – 31ms
✔ Services initialized – 56ms
✔ Express intialized – 5ms
⠙ Initializing plugins
Importing Medusa Payment Midtrans Plugin
error: Error starting server
TypeError: Cannot read properties of undefined (reading 'prototype')
at registerPaymentServiceFromClass

I got error, I create new plugin and try to test it, anyone can help ?

full sedge
#

Can you share the Packages versions and the code that product@this error please

raw osprey
raw osprey
#

there's no error now, but the payment processor is not detected in the admin ui

full sedge
#

you should extend the payment processor abstract class, where is that file located? have you build before starting?

peak berry
#

@raw osprey How was this issue released?

languid python
#

how do you resolve this issue?

jaunty acorn
#

Please I also have this issue

celest socket
#

just to be sure, did you export your class in your custom payment processor?

jaunty acorn
#

I was able to fix this by exporting default in my services.

exotic jetty
#

I am having similar error

TypeError: Cannot read properties of undefined (reading 'prototype')
    at registerPaymentServiceFromClass```

I exported the service as default yet, I still got the same error.
exotic jetty
#

I have managed to fix it. Here's what I was doing wrong:

I created a file in the 'src/services' directory without any implementation.

It appears that by default, Medusa attempts to examine any files in that directory to include them in the Medusa container. When it can't find a service class, it results in an undefined definition.

Feel free to correct me if I'm mistaken.

boreal stone
exotic jetty
#

I mean without class declaration or actual class definitions of the service.

#

If you have any empty files in your service directory, it might cause the issue. Also, ensure you follow the Medusa service implementation.