Closed ericyu049 closed 9 months ago
@shahednasser, did you have a similar experience at some point?
Yes, you can't use types imported from @medusajs/medusa
in your admin customizations, such as DiscountRuleType.FIXED
. You'll have to use its equivalent literal type "fixed"
or create a similar type to the one you're importing.
@olivermrbl maybe it's worth adding a note/troubleshooting guide about this in the documentation as I've seen another person run into it too.
@olivermrbl maybe it's worth adding a note/troubleshooting guide about this in the documentation as I've seen another person run into it too.
Sounds like a good idea 👍
Thank you very much. It's working now. Only thing is that VSCode will show it's an error, but it will compile.
You can add //@ts-ignore
before the line to disable the error showing in VSCode
Bug report
Describe the bug
Unable to use the useAdminCreateDiscount to create discount. Whenever .mutate() is added to the code in a widget, error will occur:
System information
Medusa version (including plugins): 1.19.0 Node.js version: 20.10.0 Database: PostgreSQL Operating system: MacOS Browser (if relevant):
Expected behavior
The discount code should be created and able to view it in the admin discount page.
Code snippets
Additional context
If I remove
the code will start compiling again with no issue.