#Medusa extender compatibility

92 messages · Page 1 of 1 (latest)

tired widget
#

Hi, lots of important information are consistently not given in the doc, what version of medusa does medusa extender is compatible with? Because it doesnt seems to work on the latest.

surreal gorge
#

It works with all. Some are using it with 1.7.14 which is the latest

#

There is a pr for when 1.8 will be available. I just need to clean it up

#

And i hope in the near future that all extender capabilities will be provided in medusa. I just need to validate entity enxtensibility with overriding custom repo with the new typeorm, when 1.8 will be available. If i am right it is now the only missing feature in 1.8 to deprecate the extender

tired widget
#

hi, ok thanks, well it must not works for other reasons... (copied user override store_id from the starter, cant see the ne column in the database;..

surreal gorge
#

cause you did not run the migration maybe?

tired widget
#

im working with sqlite do i need to run it?

surreal gorge
#

I don't know how sqlite works to be honnest, I usually use postgres. Plus sqlite is not recommended for prod

tired widget
#

i know but i worked with medusa js with medusa extender and i didnt need running migration while working with sqlite

#

its just because its simpler to develop what i need to develop

#

ill hapilly run migrayion but i cant find the command anywhere

#

and the medusa doc have changed

#

its quite confusing

#

can u link me to a doc explaning how to run mgration

surreal gorge
#

not sure if the migrations needs to be run for sqlite, but if you run medusa -h you ll get the command, basically medusa migrations run and for medex you also have it in the doc. Usually when a doc is pretty big you have to use the search bar to help you find the info

tired widget
#

yes no need to run it for sqlite

#

just ran it

surreal gorge
#

how do you run your project?

tired widget
#

cant understand the issue with medusa extender

#

how do i run? node and medusa develop

surreal gorge
#

Have you read the documentation? have you look at the starter?

tired widget
#

yes

surreal gorge
#

I am not sure otherwise you wouldn't use medusa develop, even in the starter the start script is explicit

tired widget
#

i extended it already withour medusa extender but had to use it because i cant extend existing entities ithout it

surreal gorge
#

package.json -> scripts -> start

tired widget
#

but i want to develop actually

#

maybe its your command that should be more explicit maybe

surreal gorge
#

yes indeed, We are missing one or two things in order to deprecate the extender in the future and do everything within medusa

#

Or maybe you should read the doc, it is literally part of the first things in the doc

tired widget
#

i m consistently being told to run medusa develp in the docs

surreal gorge
#

When you use medusa yes

#

but when you start using a tool like the extender you have to read the extender doc

#

I mean

#

Do you use docker and run medusa develop to start docker?

tired widget
#

nope

surreal gorge
#

because you read the docker doc and see that you have to run differently

tired widget
#

ok but it says ots when i start from the starter

#

i didnt use the starter

surreal gorge
tired widget
#

does it refer starter at the example starter prokect?

#

does it refer to new pristine project

#

look

surreal gorge
#

The extender is not a tool that everybody can use. It requires some knowldge and understanding of the medusa ecosystem. I do not recommand to use it otherwise

tired widget
#

Pleas eone minute

finite lake
surreal gorge
tired widget
#

jesus

#

one min

#

well i had an existing medusa project

#

i followed these steps

#

it doesnt work

#

so now i have to install the server starter?

#

it should be included as a step

#

not a different option, because i went with the first option and forgot about the other

#

idk if you understand me

surreal gorge
#

rho man

#

the first image does not appear for me

#

what steps have you done?

#

also, once you run the init command, in your package.json you can see the build and start command that you can use

#

I let you investigate a bit and come back, I have to go

#

Sorry if you feel that i have been arshed but the way you started this conversation was a bit frustrating for me 💪 when someone comes and say there is nothing in the doc (when it is the first paragraph) and then Says nothing works (because of missing the documentation) it is quite confusing

tired widget
#

sorry, ill investigate, didnt want to be rude

#

I did everything as i should, i had an exitsing project and followed the instructions "Existing medusa project"

#

im really confused , from ths point you told me to start with "npm start", it just doesnt work

surreal gorge
#

what do you get?

#

When you get an error, please share it otherwise we can't do anything for you

tired widget
#

medusa-starter-default@0.0.1 start
npm run build && NODE_ENV=development node ./dist/main.js

medusa-starter-default@0.0.1 build
rm -rf dist && ./node_modules/.bin/tsc -p tsconfig.json

sh: ./node_modules/.bin/tsc: No such file or directory

#

so to be clear when using medusa extender i should forgot about medusa develop?

surreal gorge
#

have you install the deps? npm i or yarn

tired widget
#

yes the server is working

#

fully working

surreal gorge
#

yes, as you can see there is a new entry point and the modules are passed to medusa through a custom implementation and does it for you

tired widget
#

ith admin

surreal gorge
#

medusa develop run a specific entry point that you can't change and doesn't know anything about the modules since it is on top of medusa

tired widget
#

Ok, ill explore the file, but the "Existing medusa project" getting started option should say it.. it doesnt

#

thats why i kept using medusa develop

#

just fyi

surreal gorge
#

thanks for the feedback, I could add a line to say run npm start, but since the medusa server does provide npm start with medusa develop under the hood it just seemed logic to me ahah

tired widget
#

I can imagine from your pov it looks pretty obvious xD

#

I have this error: [Server] - 3/21/2023, 6:42:14 PM [MigrationsLoader] Running migrations
Migration "addStoreIdToUser1611063162649" failed, error: SQLITE_ERROR: no such table: public.user
/Users/jbm/Dev/medusa-booking-app/backend/node_modules/typeorm/error/TypeORMError.js:9
var _this = _super.call(this, message) || this;
^

QueryFailedError: SQLITE_ERROR: no such table: public.user

#

however when inspecting the column store_id have been created

surreal gorge
#

With sqlite you don’t need to run the migrations, the schemas are generated from the entities. If I am right 🫣

tired widget
#

It tried anyway, but it stopped trying running migraytion after i added cli_migration_dirs: ["dist/**/*.migration.js"] to medusa config

tired widget
#

hi! little question, im creating several new entities, is there a default service and route model that can handle retrieving these entity by id/listing/creating and updating without copy pasting code from source and tweaking it?

surreal gorge
#

Not yet, this is something i wanted to introduce at some point in medusa but I was waiting the typeorm 3 migrations. I might do a poc at some point

tired widget
#

Alright noted 🙂

#

Thanks !

tired widget
#

Hi! when i create a service for a new entity, should i extend base service or transaction base service?

surreal gorge
#

Transaction base service. But you don’t necessarily need the extender for this use case

tired widget
#

alright, thanks 🙂