medusajs / medusa

Building blocks for digital commerce
https://medusajs.com
MIT License
24.95k stars 2.49k forks source link

Create new medusajs project fails | PaymentModuleService #8125

Closed HadiSDev closed 2 months ago

HadiSDev commented 3 months ago

Bug report

error: Could not resolve module: PaymentModuleService. Error: Loaders for module PaymentModuleService failed: column "is_enabled" of relation "payment_provider" does not exist

error: Error starting server Error: Loaders for module PaymentModuleService failed: column "is_enabled" of relation "payment_provider" does not exist

Describe the bug

I get this error after having run the npx command to create a new project.

System information

Medusa version (including plugins): preview Node.js version :v21.7.1 Database: postgres Operating system: WSL Browser (if relevant):

Steps to reproduce the behavior

  1. Create project: npx create-medusa-app@preview --db-url "postgres://root:root@162.19.134.321:32XXX/db-name"
  2. It should fail after migration but if not try npm run dev
thetutlage commented 3 months ago

Hey @HadiSDev Can you please share the screenshot of the complete error?

Also, are you trying to use an existing database when creating a new project?

HadiSDev commented 3 months ago

Hey @HadiSDev Can you please share the screenshot of the complete error?

Also, are you trying to use an existing database when creating a new project?

Yes that is correct. Should I try a clean one?

HadiSDev commented 3 months ago

I tried I clean postgres database but I still get an error:

Error: Loaders for module PaymentModuleService failed: select "p0".* from "public"."payment_provider" as "p0" where "p0"."id" in ('pp_system_default') - relation "public.payment_provider" does not exist
    at runLoaders (xxx/node_modules/@medusajs/modules-sdk/src/loaders/utils/load-internal.ts:353:14)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async loadInternalModule (xxx/node_modules/@medusajs/modules-sdk/src/loaders/utils/load-internal.ts:137:17)
    at async loadModule xxx/node_modules/@medusajs/modules-sdk/src/loaders/module-loader.ts:88:10)
    at async moduleLoader xxx/node_modules/@medusajs/modules-sdk/src/loaders/module-loader.ts:21:32)
    at async Function.bootstrap xxx/node_modules/@medusajs/modules-sdk/src/medusa-module.ts:353:7)
    at asyncxxx/node_modules/@medusajs/modules-sdk/src/medusa-app.ts:120:23
    at async Promise.all (index 17)
    at async loadModules (xxx/node_modules/@medusajs/modules-sdk/src/medusa-app.ts:91:3)
    at async MedusaApp_ (xxx/node_modules/@medusajs/modules-sdk/src/medusa-app.ts:334:22)
sradevski commented 3 months ago

@HadiSDev can you please ensure the migrations have been run? Please try following the preview docs step by step, and let me know if the issue persists.

srindom commented 2 months ago

@HadiSDev - I will close this for now as we can not reproduce in latest preview version. If this continues to be an issue please reopen with the latest details.