RSC-Labs / medusa-documents

Medusa plugin which generates documents (e.g. invoices) in PDF
MIT License
47 stars 4 forks source link

No invoice options? #8

Closed darkcherrycreative closed 3 weeks ago

darkcherrycreative commented 4 months ago

What version of medusa does this require? I'm running 1.10.0 and nothing appears. Also tried installing older versions of the plugin.

radoslaw-sz commented 4 months ago

hi @darkcherrycreative - this plugin uses the newest version of MedusaJS - 1.20.6. However, I think it shall work also for the older ones - could you please highlight what error you get? Do you see Documents option on the sidebar?

darkcherrycreative commented 4 months ago

hi @darkcherrycreative - this plugin uses the newest version of MedusaJS - 1.20.6. However, I think it shall work also for the older ones - could you please highlight what error you get? Do you see Documents option on the sidebar?

No "documents" option on the sidebar at all, or any notable changes on the admin panel. I ran migrations too, but there wasn't anything there to run.

radoslaw-sz commented 4 months ago

that's really strange.. do you have this @rsc-labs/medusa-documents in your node_modules after installation? Did you add it in your medusa-config.js with enableUI option set to true?

darkcherrycreative commented 4 months ago

that's really strange.. do you have this @rsc-labs/medusa-documents in your node_modules after installation? Did you add it in your medusa-config.js with enableUI option set to true?

I do indeed, this is from my config file:

{ resolve: @rsc-labs/medusa-documents, options: { enableUI: true } },

I checked the node_modules folder and it's there. If i intentionally misspell the name in the "resolve" section, it errors while starting, so it's finding the source for the plugin

radoslaw-sz commented 4 months ago

thanks @darkcherrycreative - ok, so the configuration and installation looks ok. Could you please check if you have any issue in the logs when you start your backend? Maybe there is some error visible. If not, after installation and before starting a backend please do yarn build. If still do not work, do you have any other plugin which works? Just to check if the problem is with loading any plugin and only this one. If other plugins work - please check if you have routes/documents inside of .cache/admin/src/extensions which is generated when you build/start backend. If is not there - then something wrong is with building a plugin. However, without knowing your exact configuration it is hard to tell what is going on. Do you have any customizations done? Is this clean backend?

darkcherrycreative commented 4 months ago

thanks @darkcherrycreative - ok, so the configuration and installation looks ok. Could you please check if you have any issue in the logs when you start your backend? Maybe there is some error visible. If not, after installation and before starting a backend please do yarn build. If still do not work, do you have any other plugin which works? Just to check if the problem is with loading any plugin and only this one. If other plugins work - please check if you have routes/documents inside of .cache/admin/src/extensions which is generated when you build/start backend. If is not there - then something wrong is with building a plugin. However, without knowing your exact configuration it is hard to tell what is going on. Do you have any customizations done? Is this clean backend?

The startup appears to go fine, no errors logged on the terminal:

yarn run v1.22.19 $ medusa develop Successfully compiled 0 files with Babel (5ms). info: Connection to Redis established ✔ Models initialized – 17ms ✔ Plugin models initialized – 810ms ✔ Strategies initialized – 39ms ⠙ Initializing modules info: Connection to Redis in module 'event-bus-redis' established ✔ Modules initialized – 323ms ✔ Database initialized – 94ms ✔ Repositories initialized – 47ms ✔ Services initialized – 13ms ✔ Express intialized – 10ms ✔ Plugins intialized – 1038ms ✔ Subscribers initialized – 70ms ✔ API initialized – 122ms ⠙ Initializing defaults info: ✔ Email service initialized info: Email templates loaded from data/emails ✔ Defaults initialized – 173ms ⠋ Initializing search engine indexing ✔ Indexing event emitted – 86ms ✔ Server is ready on port: 9000 – 12ms

I'd done a build already too.

There's no cache folder structure on my project so .cache/admin/src/extensions does not exist.

Other plugins load successfully, i've got the following in my config, but no customisations on the project at all otherwise:

medusa-fulfillment-manual, medusa-payment-manual, { resolve: @rsc-labs/medusa-documents, options: { enableUI: true, }, }, { resolve: "@rootxpdev/medusa-email-plugin", options: { templateDir: "data/emails", fromAddress: process.env.ADMIN_EMAIL, smtpHost: process.env.SMTP_HOST, smtpPort: process.env.SMTP_PORT, smtpUser: process.env.SMTP_USERNAME, smtpPassword: process.env.SMTP_PASSWORD, } }, { resolve: "medusa-plugin-filestorage-local", options: { serverBaseUrl: process.env.MEDUSA_BACKEND_URL || "http://localhost:9000", saveInDatabase: false, // recommended: false fileLocation: "uploads/persistent/", }, }, { resolve: medusa-payment-stripe, options: { api_key: STRIPE_API_KEY, webhook_secret: STRIPE_WEBHOOK_SECRET, }, }, { resolve: "@medusajs/admin", options: { autoRebuild: true, }, },

radoslaw-sz commented 4 months ago

hi @darkcherrycreative - thanks for the update. Unfortunately, I do not know yet why it is loading for you... :( Could you please check the latest version 0.8.1 and check if you see this log: Starting i18next loader... Plugin starts to use translations and we introduced a loader to load them. This log shall happen always at the startup. If it is not visible.. then I need to think how to debug it further. From what I understand, you have this plugin in node_modules so it is properly installed. For some reason Medusa does not load it, but I do not know what is a reason...

darkcherrycreative commented 4 months ago

hi @darkcherrycreative - thanks for the update. Unfortunately, I do not know yet why it is loading for you... :( Could you please check the latest version 0.8.1 and check if you see this log: Starting i18next loader... Plugin starts to use translations and we introduced a loader to load them. This log shall happen always at the startup. If it is not visible.. then I need to think how to debug it further. From what I understand, you have this plugin in node_modules so it is properly installed. For some reason Medusa does not load it, but I do not know what is a reason...

Thanks for the response. I've updated to 0.8.1 as instructed, all seems to go well and i get the logging message you mention above on startup (screenshot) but no additional options on the admin interface. I checked there were no migrations to run and also ran the build command too.

Screenshot_1

radoslaw-sz commented 4 months ago

hi @darkcherrycreative - thanks for checking this, thanks to that we know that backend of this plugin works properly so something is wrong with the Admin UI. I see you do not have other plugin which have "enableUI" option, so hard to compare if this issue is generic or related only to this plugin. Do you think it is possible to check some other plugin with enableUI option? I am trying to find some candidate - I can propose other of my plugin - https://github.com/RSC-Labs/medusa-store-analytics, but I encourage also to try some other one - unfortunately I cannot find a good candidate now.. Other plugins require some more information on top of "enableUI"...

radoslaw-sz commented 3 months ago

hi @darkcherrycreative - did you solve it maybe or you still encounter this issue?

darkcherrycreative commented 3 months ago

hi @darkcherrycreative - did you solve it maybe or you still encounter this issue?

Thanks for the nudge! I've actually been unable to get any other plugin working that features the "enableUI" flag. After a bit of additional digging around it seems to be that i'm using a version of Medusa admin that doesn't have this feature enabled. I forget the exact version this was introduced, but i need to perform an upgrade before i can use it.

The whole Medusa upgrade process is very haphazard in my opinion, it's not well documented at all.

When i get the chance to upgrade the frontend to be compatible with the newer Medusa versions i'm going to give this plugin another go.

radoslaw-sz commented 1 month ago

hi @darkcherrycreative - any news? :)

radoslaw-sz commented 3 weeks ago

hi @darkcherrycreative - I am closing it due to inactivity, feel free to reopen again :)