Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service Type Error #122

Closed
itzomen opened this issue Aug 21, 2022 · 2 comments
Closed

Service Type Error #122

itzomen opened this issue Aug 21, 2022 · 2 comments

Comments

@itzomen
Copy link

itzomen commented Aug 21, 2022

Describe the bug
I keep getting type errors when I create a custom service. This happens when import { StoreService as MedusaStoreService } from "@medusajs/medusa/dist/services";. Seems like the types exist on medusa-interfaces because importing import { BaseService as MedusaStoreService } from "medusa-interfaces"; get rid of the errors

To Reproduce
Steps to reproduce the behavior:

  1. Follow the Create Marketplace Tutorial part 1
  2. The store.service and user.service throws the following errors

Expected behavior
Normally, we should not get any type Error, except I am doing something wrong

Screenshots

Screenshot from 2022-08-21 15-38-03

Screenshot from 2022-08-21 15-38-28

Screenshot from 2022-08-21 15-38-39

Package version:

  • Version 1.7.4

Additional context

# medusa versions
"@medusajs/medusa": "^1.3.5",
"@medusajs/medusa-cli": "^1.3.1",
@adrien2p
Copy link
Owner

adrien2p commented Aug 21, 2022

In the newest version of medusa, the service extends the TransactionBaseService and not the baseService. So you don't need to implement the withTransaction anymore ☺️ the actual tutorial was implementing it the old way and this is why you get that error. You can look more into the extender documentation

@itzomen
Copy link
Author

itzomen commented Aug 21, 2022

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants