Closed StevenChege closed 1 year ago
Can you please screenshot or video for that issue?
I have the same error
EDIT: Looks like this was made for an old version of Medusajs or is not finish the implementation Found the error, going to add a try catch on utils/server.ts ,Here are some pictures, looks like it needs some modification for medusajs @StevenChege take a look to this,
Thanks @acidlake, but i still can't make it work. I found the issue stems from my medusa server, with ProductCategory
id
missing or mismatch . What ProductCategory schema is compatible?
Here is a screenshot.
@StevenChege i'm doing modifications to the source code for medusa, since it looks like its using an older version, for the categories id it should be something like: pcat_shirts, also add http://localhost:3000 to your medusa backend store cors, i manage to show some products, but still lot of work to do, i'm changing the code to take into consideration the current medusa version, at least you can login, logout, singup, but still needs to change more stuff
@StevenChege this is an screen from my medusa server
@acidlake The categories from medusa server looks fine. Is svelte-commerce working fine your side?
@itswadesh so far is a mixbag, but i manage to successfully connect, i'm doing changes on svelte-commerce source code to make it work as expected, search don't work, homepage don't show anything, categories are working, but product details is not, still lot of things to fix, once im done il see if i can do a PR, and check if the owner of svelte-commerce accept it, if no il share a repo
@acidlake Please do the PR. I will try to merge it as fast as possible, we are looking for such contribution towards medusajs integration. With litekart backend svelte-commerce is working excellent. Our next target is to finish up MedusaJs.
@itswadesh o thanks a lot, my bad, dint't notice that you are the creator of the repo, il do the PR once im done!!, very great product!
Ok guys, quick update, so far good progress, here is how the product page looks, i also created a basic image gallery for the product detail page, so far working great with medusa, il continue with the other fixes.
@acidlake if you have anything to share in a fork please share , it will be really appreciated - thank you
@acidlake Can you please share?
@acidlake if you can share we can try to give a hand there
Hello guys, sorry for the time, at first i as doing the changes for my project, however i did a lot of changes to the project that break the other integrations, such as woocomerce, bigcommerce etc, my suggesstion is to create some sort of adapters, that we can plug in for medusaje, woocomerce, bigcommerce etc, we may need to abstract and refactor the project, so the storefront should work with any adapter that we add, again, the modifications that i made as for my project, and since i was just using medusajs, it broke the other integrations, so an adaptar should work. or separate the project for medusajs only but that would created more work
Hi, thanks for the update. Can you please push it to a different branch, so that we can have a look and make necessary changes to keep other services working and eventually merge it into master.
We though of making a adaptor for each of those services, where as it would make the developer experience difficult, like F12 key won't work to navigate to the exact method.
Ideas are welcome.
Thank you @acidlake and congrats for the new member. As for the right way to decouple , I think we will be smarter once we see the actual changes. As long as we stick with having all adaptors in same repo and uncommenting the implementation we want , the files navigation works on both IJ and Code. If we keep it all in monorepo with dependencies to the adaptors it may help with the navigation issue , and maybe in general will be good evolution.
@acidlake and @itswadesh I started reviewing the current Medusa APIs , most of them are not working as expected , While medusa BE expects mainly Ids , APIs are working with slug(Or handle in mesua terms) There's a need to call other APIs to accomplish that. (Sometimes more than one , unless we change the call to pass both slug and Id) Also I noticed that APIs called are not calling the exact API needed for example getting category products returns all products. I guess there are more to follow. One more thing , sometimes the APIs are called from the UI , sometimes from from the server.js , I would expect some consistency , as my knowledge in sveltekit preparing the data to the page should be in server.js (This alone can solve CORS issue we may have with the BE) @acidlake if you can make the branch I think I can take it from there
Tsemach
Thank you @acidlake and congrats for the new member. As for the right way to decouple , I think we will be smarter once we see the actual changes. As long as we stick with having all adaptors in same repo and uncommenting the implementation we want , the files navigation works on both IJ and Code. If we keep it all in monorepo with dependencies to the adaptors it may help with the navigation issue , and maybe in general will be good evolution.
@tsemachh thank you so much for taking time studying the under laying structure and the suggestion. If it solves the file navigations issue, surely mono repo will be a good idea. Would it be possible to setup the file structure, while @acidlake push the changes to a new branch or raise a pull request.
@itswadesh I do prefer to get @acidlake PR first so I will have full view of the changes made . What I can say in general 2 things:
@tsemachh This is interesting, and will give a lot of performance improvements. However I have following questions.
Basically in order to support incremental SSG there's a case opened , And Vercel has support for it if you run there - https://vercel.com/docs/concepts/incremental-static-regeneration. Since this is the case , what I did in other project is to generate just the changes and deploy them into the site. You can define when you generate the changes which routes to re-generate , this way you can have better control of what's generated without waiting for case resolution. BTW: I did saw that the project does not support product variants which is basic for our case in MedusaJs so we may choose another StoreFront (Unless @acidlake provided decent support for it)
Hello Guys, i'm working on the PR at this moment, since originally i fixing the project for my own storefront with different requirements etc, and i was removing everything related to the other backends, since i was keeping medusajs, i created a new fork, and im uploading my changes.
Awesome, thanks for the update!
On Mon, Jul 24, 2023, 17:45 Jeremias Nunez @.***> wrote:
Hello Guys, i'm working on the PR at this moment, since originally i fixing the project for my own storefront with different requirements etc, and i was removing everything related to the other backends, since i was keeping medusajs, i created a new fork, and im uploading my changes.
— Reply to this email directly, view it on GitHub https://github.com/itswadesh/svelte-commerce/issues/70#issuecomment-1648055978, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPJPWRGCVCMOT24B6WKV5DXR2DCBANCNFSM6AAAAAAYHQ66CU . You are receiving this because you were mentioned.Message ID: @.***>
Ok guys quick update, there's still a lot of work todo, but at least now the products are being show, categories, product detail page. so you guys can take a look tot he PR, download the branch and take a look.
Started looking into all the pull requests. Let's connect on discord before merging so that we can discuss all the aspects to it
I will be available 11:00-19:00 GMT
i see some comments regardles break of SaaS, when i checked this project i was testing medusajs, but since the storefront needs a loot of work and medusajs still lacks some features, i switched to Saleor, but i decided to create a storefront from scratch, that's why i took to long to upload the changes, since i was already finish with the testings in this project and medusa and i deleted that repo, but didn't know that this project was part of a SaaS, my suggest is to focus on one storefront at the time, for example, i see the project is very harcoded to support litekart, which i asume is your SaaS, in order to support more backends and have better customization, better DX, is better to create a generic solution, with adapters, or services that can be easy switch, and customized for that spesific project, i added an option to switch from one service to other very easy, but like i say, the project is too heavy on litekart, so it would be better to drop the support for medusajs, and be focus on litekart
We are committed to integrate as many storefronts we can, and this repo has that capability.
Medusa is still under heavy development. To make the storefront fully functional we 1st tried to integrate with Litekart which is working 100%. Next step is to integrate Medusajs.
Regarding SaaS compatibility, there is only 1 line that has to be changed.
Regarding Medusajs compatibility we are also working on it in sync with Medusa development, and have completed a lot of integration, its just matter of cleanup and some branch merger.
We are keeping it all together just for simplicity and developer experience.
@acidlake if you can create a pull request on the feat/medusajs-api-integration branch instead of master, I will have a look how can we make it compatible with both the ecommerce platforms.
Got it, i switched the pr to the feat/medusajs-api-integration branch @itswadesh
@itswadesh From my experience it's very hard to maintain customizable UI. If you want to make it work with various APIs , you need maybe in UI/Store level to control display of elements on the store. I agree the storefront can be used with various APIs but there's still work need to be done. I would start with:
@tsemachh Thank you so much for your insights.
I am trying my best to accommodate different store api without breaking each other.
@tsemachh @acidlake Merged the pull request to the master. I had to take down 1-2 commits just the keep the dev experience upto the mark.
nice, should we close this issue, since the Unhandled promise rejection get solved with the PR merged to master
@itswadesh and @acidlake - thank you very much for pushing it forward. @itswadesh is there any branch which has medusajs API changes ? we still see gaps and would like to add our insights there.
@tsemachh Medusa is merged into master, can be activated from services/index.ts
file.
Can you please specify the exact error
Many of the APIs are not functioning properly:
Thanks @tsemachh for letting us know, the issues are fixed now
Thank you @itswadesh it looks better from first view I still see the API:
fetchProductsOfCategory
res = await getMedusajsApi(products?category_id[]=${categorySlug}
)
category_id != categorySlug
You will need to get the id first and then use it in the API
Good luck though
Description I have a
medusajs
backend. I cloned this repo, added medusa-backend-url in.env
file, exported medusa in thesrc/lib/services/index.ts
directory, then installed dependencies. When i run the app it starts correctly but brings an error(shown below) and the server stops. Is there anything i'm missing?Error message
VITE v4.3.7 ready in 27283 ms
➜ Local: http://localhost:3000/ ➜ Network: http://192.168.22.112:3000/ ➜ Network: http://10.42.0.1:3000/ ➜ press h to show help 10:21:04 AM [vite-plugin-svelte] /node_modules/svelte-toasts/src/FlatToast.svelte:37:0 A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event. 10:21:07 AM [vite-plugin-svelte] /node_modules/svelte-toasts/src/BootstrapToast.svelte:23:0 A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event. node:internal/process/promises:265 triggerUncaughtException(err, true / fromPromise /); ^
[UnhandledPromiseRejection: 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(). The promise rejected with the reason "[object Object]".] { code: 'ERR_UNHANDLED_REJECTION' }