shahednasser / medusa-marketplace

Create a Marketplace with Medusa
79 stars 16 forks source link

UnhandledPromiseRejectionWarning: TypeError: this.validateId_ is not a function #11

Open jtqfaire opened 2 years ago

jtqfaire commented 2 years ago

Hi,

I'am trying to use this plugin but it doesn't works when i'am trying to create a new user because the following error appears:

npm run start

> medusa-starter-default@0.0.1 start /home/kereval.com/bcu/perso/lrvlb/lrvlb
> npm run build && NODE_ENV=development node ./dist/main.js

> medusa-starter-default@0.0.1 build /home/kereval.com/bcu/perso/lrvlb/lrvlb
> rm -rf dist && ./node_modules/.bin/tsc -p tsconfig.json

[Server]      - 8/25/2022, 7:11:42 AM   [ValidatorsLoader] Loading custom validators into the underlying @medusajs
[Server]      - 8/25/2022, 7:11:42 AM   [ValidatorsLoader] 0 validators applied
[Server]      - 8/25/2022, 7:11:42 AM   [EntitiesLoader] Loading overridden entities into the underlying @medusajs
[Server]      - 8/25/2022, 7:11:42 AM   [EntitiesLoader] Entity overridden - User
[Server]      - 8/25/2022, 7:11:42 AM   [EntitiesLoader] Entity overridden - Product
[Server]      - 8/25/2022, 7:11:42 AM   [EntitiesLoader] Entity overridden - Store
[Server]      - 8/25/2022, 7:11:42 AM   [EntitiesLoader] Entity overridden - Order
[Server]      - 8/25/2022, 7:11:42 AM   [EntitiesLoader] Entity overridden - Invite
[Server]      - 8/25/2022, 7:11:42 AM   [EntitiesLoader] 5 entities overridden
[Server]      - 8/25/2022, 7:11:42 AM   [RepositoriesLoader] Loading overridden entities into the underlying @medusajs
[Server]      - 8/25/2022, 7:11:42 AM   [RepositoriesLoader] Repository overridden - UserRepository
[Server]      - 8/25/2022, 7:11:42 AM   [RepositoriesLoader] Repository overridden - ProductRepository
[Server]      - 8/25/2022, 7:11:42 AM   [RepositoriesLoader] Repository overridden - StoreRepository
[Server]      - 8/25/2022, 7:11:42 AM   [RepositoriesLoader] Repository overridden - OrderRepository
[Server]      - 8/25/2022, 7:11:42 AM   [RepositoriesLoader] Repository overridden - InviteRepository
[Server]      - 8/25/2022, 7:11:42 AM   [RepositoriesLoader] 5 repositories overridden
[Server]      - 8/25/2022, 7:11:42 AM   [ServicesLoader] Loading services into the underlying @medusajs
[Server]      - 8/25/2022, 7:11:42 AM   [SubscribersLoader] Loading custom subscribers into the underlying @medusajs
[Server]      - 8/25/2022, 7:11:42 AM   [SubscribersLoader] 1 subscribers built
✔ Models initialized – 32ms
✔ Plugin models initialized – 2ms
✔ Repositories initialized – 58ms
⠋ Initializing database[Server]      - 8/25/2022, 7:11:42 AM   [EntitiesLoader] Loading custom entities into the underlying @medusajs
[Server]      - 8/25/2022, 7:11:42 AM   [EntitiesLoader] Entity loaded - role
[Server]      - 8/25/2022, 7:11:42 AM   [EntitiesLoader] Entity loaded - permission
[Server]      - 8/25/2022, 7:11:42 AM   [EntitiesLoader] 2 entities registered
[Server]      - 8/25/2022, 7:11:42 AM   [RepositoriesLoader] Loading custom entities into the underlying @medusajs
[Server]      - 8/25/2022, 7:11:42 AM   [RepositoriesLoader] Repository loaded - roleRepository
[Server]      - 8/25/2022, 7:11:42 AM   [RepositoriesLoader] Repository loaded - permissionRepository
[Server]      - 8/25/2022, 7:11:42 AM   [RepositoriesLoader] 2 repositories registered
[Server]      - 8/25/2022, 7:11:42 AM   [MigrationsLoader] Registering migrations into the ORM connection
[Server]      - 8/25/2022, 7:11:42 AM   [MigrationsLoader] Running migrations
✔ Database initialized – 81ms
✔ Strategies initialized – 5ms
⠋ Initializing services[Server]      - 8/25/2022, 7:11:42 AM   [ServicesLoader] Service overridden - UserService
[Server]      - 8/25/2022, 7:11:42 AM   [ServicesLoader] Service overridden - ProductService
[Server]      - 8/25/2022, 7:11:42 AM   [ServicesLoader] Service overridden - StoreService
[Server]      - 8/25/2022, 7:11:42 AM   [ServicesLoader] Service overridden - OrderService
[Server]      - 8/25/2022, 7:11:42 AM   [ServicesLoader] Service overridden - InviteService
[Server]      - 8/25/2022, 7:11:42 AM   [ServicesLoader] 0 services registered
[Server]      - 8/25/2022, 7:11:42 AM   [ServicesLoader] 5 services overridden
✔ Services initialized – 12ms
✔ Express intialized – 7ms
✔ Plugins intialized – 6ms
✔ Subscribers initialized – 6ms
⠋ Initializing API[Server]      - 8/25/2022, 7:11:42 AM   [MiddlewaresLoader] Loading custom middlewares to apply before the underlying @medusajs authentication
[Server]      - 8/25/2022, 7:11:42 AM   [MiddlewaresLoader] 0 before auth middleware registered
[Server]      - 8/25/2022, 7:11:42 AM   [MiddlewaresLoader] Loading custom middlewares to apply after the underlying @medusajs authentication
[Server]      - 8/25/2022, 7:11:42 AM   [MiddlewaresLoader] 0 after auth middleware registered
[Server]      - 8/25/2022, 7:11:42 AM   [MiddlewaresLoader] Loading custom middlewares to apply before the underlying @medusajs authentication
[Server]      - 8/25/2022, 7:11:42 AM   [MiddlewaresLoader] Middleware before auth loaded - AttachUserSubscriberMiddleware
[Server]      - 8/25/2022, 7:11:42 AM   [MiddlewaresLoader] 1 before auth middleware registered
[Server]      - 8/25/2022, 7:11:42 AM   [MiddlewaresLoader] Loading custom middlewares to apply after the underlying @medusajs authentication
[Server]      - 8/25/2022, 7:11:42 AM   [MiddlewaresLoader] Middleware after auth loaded - LoggedInUserMiddleware
[Server]      - 8/25/2022, 7:11:42 AM   [MiddlewaresLoader] Middleware after auth loaded - AttachProductSubscribersMiddleware
[Server]      - 8/25/2022, 7:11:42 AM   [MiddlewaresLoader] Middleware after auth loaded - AttachInviteSubscriberMiddleware
[Server]      - 8/25/2022, 7:11:42 AM   [MiddlewaresLoader] 3 after auth middleware registered
[Server]      - 8/25/2022, 7:11:42 AM   [MiddlewaresLoader] Loading custom middlewares to apply before the underlying @medusajs authentication
[Server]      - 8/25/2022, 7:11:42 AM   [MiddlewaresLoader] 0 before auth middleware registered
[Server]      - 8/25/2022, 7:11:42 AM   [MiddlewaresLoader] Loading custom middlewares to apply after the underlying @medusajs authentication
[Server]      - 8/25/2022, 7:11:42 AM   [MiddlewaresLoader] 0 after auth middleware registered
✔ API initialized – 19ms
⠙ Initializing defaultswarn:    You don't have any notification provider plugins installed. You may want to add one to your project.
warn:    You don't have any taxProviders provider plugins installed. You may want to add one to your project.
✔ Defaults initialized – 151ms
⠋ Initializing search engine indexingwarn:    No search engine provider was found: make sure to include a search plugin to enable searching
✔ Indexing event emitted – 9ms
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/health, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/users, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/users, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/create-user, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/invites/accept, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/auth, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/auth, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/auth, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/users/password-token, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/users/reset-password, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/products, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/products, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/invites*, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/apps, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/apps/authorizations, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/batch-jobs, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/batch-jobs, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/batch-jobs/:id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/batch-jobs/:id/confirm, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/batch-jobs/:id/cancel, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/collections, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/collections, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/collections/:id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/collections/:id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/collections/:id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/collections/:id/products/batch, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/collections/:id/products/batch, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/customer-groups, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/customer-groups, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/customer-groups/:id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/customer-groups/:id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/customer-groups/:id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/customer-groups/:id/customers, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/customer-groups/:id/customers/batch, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/customer-groups/:id/customers/batch, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/customers, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/customers, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/customers/:id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/customers/:id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/discounts, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/discounts, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/discounts/:discount_id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/discounts/:discount_id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/discounts/:discount_id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/discounts/code/:code, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/discounts/:discount_id/dynamic-codes, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/discounts/:discount_id/dynamic-codes/:code, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/discounts/:discount_id/regions/:region_id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/discounts/:discount_id/regions/:region_id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/discounts/:discount_id/conditions/:condition_id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/discounts/:discount_id/conditions/:condition_id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/discounts/:discount_id/conditions/:condition_id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/discounts/:discount_id/conditions, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/draft-orders, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/draft-orders, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/draft-orders/:id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/draft-orders/:id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/draft-orders/:id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/draft-orders/:id/line-items/:line_id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/draft-orders/:id/line-items/:line_id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/draft-orders/:id/line-items, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/draft-orders/:id/pay, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/gift-cards, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/gift-cards, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/gift-cards/:id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/gift-cards/:id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/gift-cards/:id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/invites, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/invites, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/invites/:invite_id/resend, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/invites/:invite_id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/notes/:id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/notes/:id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/notes/:id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/notes, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/notes, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/notifications, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/notifications/:id/resend, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/complete, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/refund, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/capture, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/fulfillment, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/fulfillments/:fulfillment_id/cancel, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/swaps/:swap_id/fulfillments/:fulfillment_id/cancel, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/claims/:claim_id/fulfillments/:fulfillment_id/cancel, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/shipment, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/return, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/cancel, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/shipping-methods, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/archive, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/swaps, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/swaps/:swap_id/cancel, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/swaps/:swap_id/fulfillments, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/swaps/:swap_id/shipments, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/swaps/:swap_id/process-payment, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/claims, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/claims/:claim_id/cancel, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/claims/:claim_id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/claims/:claim_id/fulfillments, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/orders/:id/claims/:claim_id/shipments, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/price-lists/:id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/price-lists/:id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/price-lists/:id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/price-lists, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/price-lists, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/price-lists/:id/products, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/price-lists/:id/products/:product_id/prices, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/price-lists/:id/variants/:variant_id/prices, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/price-lists/:id/prices/batch, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/price-lists/:id/prices/batch, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/products/:id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/products/:id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/products/:id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/products/types, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/products/tag-usage, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/products/:id/variants, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/products/:id/variants, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/products/:id/variants/:variant_id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/products/:id/variants/:variant_id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/products/:id/options/:option_id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/products/:id/options/:option_id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/products/:id/options, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/products/:id/metadata, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/product-tags, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/product-types, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/regions, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/regions, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/regions/:region_id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/regions/:region_id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/regions/:region_id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/regions/:region_id/fulfillment-options, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/regions/:region_id/countries, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/regions/:region_id/countries/:country_code, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/regions/:region_id/payment-providers, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/regions/:region_id/payment-providers/:provider_id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/regions/:region_id/fulfillment-providers, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/regions/:region_id/fulfillment-providers/:provider_id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/return-reasons, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/return-reasons, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/return-reasons/:id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/return-reasons/:id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/return-reasons/:id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/returns, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/returns/:id/receive, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/returns/:id/cancel, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/sales-channels, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/sales-channels, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/sales-channels/:id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/sales-channels/:id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/sales-channels/:id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/sales-channels/:id/products/batch, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/sales-channels/:id/products/batch, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/shipping-options, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/shipping-options, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/shipping-options/:option_id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/shipping-options/:option_id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/shipping-options/:option_id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/shipping-profiles, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/shipping-profiles, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/shipping-profiles/:profile_id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/shipping-profiles/:profile_id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/shipping-profiles/:profile_id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/store, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/store, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/store/payment-providers, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/store/tax-providers, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/store/currencies/:currency_code, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/store/currencies/:currency_code, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/swaps, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/swaps/:id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/tax-rates, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/tax-rates, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/tax-rates/:id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/tax-rates/:id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/tax-rates/:id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/tax-rates/:id/products/batch, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/tax-rates/:id/products/batch, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/tax-rates/:id/product-types/batch, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/tax-rates/:id/product-types/batch, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/tax-rates/:id/shipping-options/batch, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/tax-rates/:id/shipping-options/batch, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/uploads, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/uploads, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/uploads/download-url, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/users/:user_id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/users/:user_id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/users/:user_id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/admin/variants, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/auth, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/auth, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/auth, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/auth/:email, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/collections, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/collections/:id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/customers, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/customers/password-reset, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/customers/password-token, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/customers/me, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/customers/me, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/customers/me/orders, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/customers/me/addresses, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/customers/me/addresses/:address_id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/customers/me/addresses/:address_id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/customers/me/payment-methods, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/products, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/products/search, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/products/:id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/orders, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/orders/:id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/orders/cart/:cart_id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/carts/:id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/carts/:id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/carts, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/carts/:id/complete, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/carts/:id/complete-cart, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/carts/:id/line-items, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/carts/:id/line-items/:line_id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/carts/:id/line-items/:line_id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/carts/:id/discounts/:code, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/carts/:id/payment-sessions, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/carts/:id/payment-sessions/:provider_id, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/carts/:id/payment-sessions/:provider_id, DELETE}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/carts/:id/payment-sessions/:provider_id/refresh, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/carts/:id/payment-session, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/carts/:id/shipping-methods, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/carts/:id/taxes, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/shipping-options, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/shipping-options/:cart_id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/regions, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/regions/:region_id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/swaps/:cart_id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/swaps, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/variants, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/variants/:id, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/returns, POST}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/gift-cards/:code, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/return-reasons, GET}
[Server]      - 8/25/2022, 7:11:42 AM   [Medusa] Route Mapped {/store/return-reasons/:id, GET}
Server successfully started on port 9000
(node:493121) UnhandledPromiseRejectionWarning: TypeError: this.validateId_ is not a function
    at UserService.retrieve (/home/kereval.com/bcu/perso/lrvlb/lrvlb/node_modules/medusa-marketplace/dist/modules/user/user.service.js:26:34)
    at consume (/home/kereval.com/bcu/perso/lrvlb/lrvlb/node_modules/medusa-marketplace/dist/modules/user/loggedInUser.middleware.js:14:48)
    at Layer.handle [as handle_request] (/home/kereval.com/bcu/perso/lrvlb/lrvlb/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/kereval.com/bcu/perso/lrvlb/lrvlb/node_modules/express/lib/router/route.js:144:13)
    at Route.dispatch (/home/kereval.com/bcu/perso/lrvlb/lrvlb/node_modules/express/lib/router/route.js:114:3)
    at Layer.handle [as handle_request] (/home/kereval.com/bcu/perso/lrvlb/lrvlb/node_modules/express/lib/router/layer.js:95:5)
    at /home/kereval.com/bcu/perso/lrvlb/lrvlb/node_modules/express/lib/router/index.js:284:15
    at param (/home/kereval.com/bcu/perso/lrvlb/lrvlb/node_modules/express/lib/router/index.js:365:14)
    at param (/home/kereval.com/bcu/perso/lrvlb/lrvlb/node_modules/express/lib/router/index.js:376:14)
    at Function.process_params (/home/kereval.com/bcu/perso/lrvlb/lrvlb/node_modules/express/lib/router/index.js:421:3)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:493121) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:493121) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

And the request stay in "Loading..." state in Postman:

image

Any idea how what's happen ?

I can authenticate a user create with the medusa client (ex: medusa user -e test@test.com -p test)

image

But the store_id is null.

My src/main.ts:

import express = require('express');
const config = require('../medusa-config');
import { Medusa } from 'medusa-extender';
import { resolve } from 'path';
import { ExampleModule } from './modules/example/example.module';
import { ProductModule, UserModule, StoreModule, OrderModule, RoleModule, PermissionModule, InviteModule } from 'medusa-marketplace';

async function bootstrap() {
    const expressInstance = express();

    await new Medusa(resolve(__dirname, '..'), expressInstance).load([
  UserModule,
  ProductModule,
  StoreModule,
  OrderModule,
  RoleModule,
  PermissionModule,
  InviteModule
]);

    const port = config?.serverConfig?.port ?? 9000;
    expressInstance.listen(port, () => {
        console.info('Server successfully started on port ' + port);
    });
}

bootstrap();

Thx for your help

manojvirat457 commented 2 years ago

Getting same error,


F:\Medusa\Portal\SkryptStore\backend\node_modules\medusa-marketplace\dist\modules\user\user.service.js:26
        const validatedId = this.validateId_(userId);
                                 ^

TypeError: this.validateId_ is not a function
    at UserService.retrieve (F:\Medusa\Portal\SkryptStore\backend\node_modules\medusa-marketplace\dist\modules\user\user.service.js:26:34)        
    at consume (F:\Medusa\Portal\SkryptStore\backend\node_modules\medusa-marketplace\dist\modules\user\loggedInUser.middleware.js:14:48)
    at Layer.handle [as handle_request] (F:\Medusa\Portal\SkryptStore\backend\node_modules\express\lib\router\layer.js:95:5)
    at next (F:\Medusa\Portal\SkryptStore\backend\node_modules\express\lib\router\route.js:144:13)
    at Route.dispatch (F:\Medusa\Portal\SkryptStore\backend\node_modules\express\lib\router\route.js:114:3)
    at Layer.handle [as handle_request] (F:\Medusa\Portal\SkryptStore\backend\node_modules\express\lib\router\layer.js:95:5)
    at F:\Medusa\Portal\SkryptStore\backend\node_modules\express\lib\router\index.js:284:15
    at param (F:\Medusa\Portal\SkryptStore\backend\node_modules\express\lib\router\index.js:365:14)
    at param (F:\Medusa\Portal\SkryptStore\backend\node_modules\express\lib\router\index.js:376:14)
    at Function.process_params (F:\Medusa\Portal\SkryptStore\backend\node_modules\express\lib\router\index.js:421:3)

main.ts

import express = require('express');
const config = require('../medusa-config');
import { Medusa } from 'medusa-extender';
import { resolve } from 'path';
import { ProductModule, UserModule, StoreModule, OrderModule, InviteModule, RoleModule, PermissionModule } from 'medusa-marketplace';

async function bootstrap() {
    const expressInstance = express();

    await new Medusa(resolve(__dirname, '..'), expressInstance).load(
        [
            UserModule,
            ProductModule,
            StoreModule,
            OrderModule,
            InviteModule,
            RoleModule,
            PermissionModule
        ]
    );

    const port = config?.serverConfig?.port ?? 9000;
    expressInstance.listen(port, () => {
        console.info('Server successfully started on port ' + port);
    });
}

bootstrap();
adrien2p commented 2 years ago

This.validateId_ is now an util and must be imported separatly

matiasf commented 2 years ago

Hi @adrien2p, same issue here, I try to found this util on marketplace-plugin, medusa-extender and medusa core but couldn't find it to try to fix this issue. Do you know where this util is to fix this problem?

adrien2p commented 2 years ago

It is in medusa/dist/utils/validate-id if it is not already exported by the utils/index https://github.com/medusajs/medusa/blob/master/packages/medusa/src/utils/validate-id.ts

Also, most of the tile it is not used, which is why the core does not use it very much. If you only pass the id the util will not do anything

matiasf commented 2 years ago

I'm trying to overwrite de created services by marketplace-plugin with extender to change this behavior to use the util for validateId and buildQuery, which was another failing method. Now all my class looks good but have trouble to override the service and gives me the next error:

medusa-server-default | 
medusa-server-default | src/modules/user/user.service.ts(33,5): error TS2416: Property 'withTransaction' in type 'UserService' is not assignable to the same property in base type 'UserService'.
medusa-server-default |   Type '(transactionManager: EntityManager) => UserService' is not assignable to type '(transactionManager?: EntityManager) => this'.
medusa-server-default |     Type 'UserService' is not assignable to type 'this'.
medusa-server-default |       'UserService' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'UserService'.

My current class is this:

import { EntityManager } from "typeorm";
import EventBusService from "@medusajs/medusa/dist/services/event-bus";
import { FindConfig } from "@medusajs/medusa/dist/types/common";
import Utils from "@medusajs/medusa/dist/utils";
import { MedusaError } from "medusa-core-utils";
import MedusaMarketplaceUserService from "medusa-marketplace/dist/modules/user/user.service";
import { Service } from "medusa-extender";
import { User } from "medusa-marketplace/dist/modules/user/user.entity";
import UserRepository from "medusa-marketplace/dist/modules/user/user.repository";

type ConstructorParams = {
    manager: EntityManager;
    userRepository: typeof UserRepository;
    eventBusService: EventBusService;
    loggedInUser?: User;
};

@Service({ override: MedusaMarketplaceUserService })
export default class UserService extends MedusaMarketplaceUserService {
    private readonly manager: EntityManager;
    private readonly userRepository: typeof UserRepository;
    private readonly eventBus: EventBusService;

    constructor(private readonly container: ConstructorParams) {
        super(container);
        this.manager = container.manager;
        this.userRepository = container.userRepository;
        this.eventBus = container.eventBusService;
        this.container = container;
    }

    withTransaction(transactionManager: EntityManager): UserService {
        if (!transactionManager) {
            return this;
        }

        const cloned = new UserService({
            ...this.container,
            manager: transactionManager,
        });

        cloned.transactionManager_ = transactionManager;

        return cloned;
    }

    public async retrieve(
        userId: string,
        config?: FindConfig<User>
    ): Promise<User> {
        const userRepo = this.manager.getCustomRepository(this.userRepository);
        const validatedId = Utils.validateId(userId);
        const query = Utils.buildQuery({ id: validatedId }, config);

        const user = await userRepo.findOne(query);

        if (!user) {
            throw new MedusaError(
                MedusaError.Types.NOT_FOUND,
                `User with id: ${userId} was not found`
            );
        }

        return user as User;
    }

    public async addUserToStore(user_id, store_id) {
        await this.atomicPhase_(async (m) => {
            const userRepo = m.getCustomRepository(this.userRepository);
            const query = Utils.buildQuery({ id: user_id });

            const user = await userRepo.findOne(query);
            if (user) {
                user.store_id = store_id;
                await userRepo.save(user);
            }
        });
    }
}

I'm newbie with Typescript, but is this a good approach to fix the issue with extender?

ahsanwtc commented 1 year ago

getting the same error