Skip to content

[Bug]: Unable to initialize db after project checkout #165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
nicoladistefano opened this issue Mar 15, 2025 · 1 comment
Open

[Bug]: Unable to initialize db after project checkout #165

nicoladistefano opened this issue Mar 15, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@nicoladistefano
Copy link

Package.json file

{
  "name": "medusa-b2b-starter",
  "version": "0.0.1",
  "description": "A starter for Medusa B2B projects.",
  "author": "Medusa (https://medusajs.com)",
  "license": "MIT",
  "keywords": [
    "sqlite",
    "postgres",
    "typescript",
    "ecommerce",
    "headless",
    "medusa"
  ],
  "scripts": {
    "build": "medusa build",
    "seed": "medusa exec ./src/scripts/seed.ts",
    "start": "medusa start",
    "dev": "medusa develop",
    "test:integration:http": "TEST_TYPE=integration:http NODE_OPTIONS=--experimental-vm-modules jest --silent=false --runInBand --forceExit",
    "test:integration:modules": "TEST_TYPE=integration:modules NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --forceExit",
    "test:unit": "TEST_TYPE=unit NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --forceExit"
  },
  "dependencies": {
    "@medusajs/admin-sdk": "2.5.1",
    "@medusajs/cli": "2.5.1",
    "@medusajs/framework": "2.5.1",
    "@medusajs/js-sdk": "2.5.1",
    "@medusajs/medusa": "2.5.1",
    "@medusajs/ui": "4.0.6",
    "@mikro-orm/core": "6.4.3",
    "@mikro-orm/knex": "6.4.3",
    "@mikro-orm/migrations": "6.4.3",
    "@mikro-orm/postgresql": "6.4.3",
    "awilix": "^8.0.1",
    "pg": "^8.13.0",
    "zod": "3.22.4"
  },
  "devDependencies": {
    "@medusajs/test-utils": "2.5.1",
    "@medusajs/ui-preset": "2.5.1",
    "@mikro-orm/cli": "6.4.3",
    "@swc/core": "^1.5.7",
    "@swc/jest": "^0.2.36",
    "@types/jest": "^29.5.14",
    "@types/node": "^20.0.0",
    "@types/react": "^18.3.2",
    "@types/react-dom": "^18.2.25",
    "jest": "^29.7.0",
    "prop-types": "^15.8.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "ts-node": "^10.9.2",
    "typescript": "^5.5.3",
    "vite": "^5.2.11"
  },
  "engines": {
    "node": ">=20"
  },
  "packageManager": "[email protected]"
}

Node.js version

v20.19.0

Operating system name and version

macOS 15.3.1

Browser name

No response

What happended?

I’m trying to check out project for the first time, following the official guide. When I reach the step where the database is created, I notice that the database is created successfully, but it is not populated with the necessary data.

Steps to reproduce:

Clone the repository.
Follow the instructions in the README
Run the command `yarn install && yarn medusa db:create && yarn medusa db:migrate && yarn run seed && yarn medusa user -e [email protected] -p supersecret -i admin`

Expected behavior

The database should be created and populated with example data, as described in the guide.

Actual behavior

yarn install && yarn medusa db:create && yarn medusa db:migrate && yarn run seed && yarn medusa user -e [email protected] -p supersecret -i admin
➤ YN0000: · Yarn 4.4.1
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Post-resolution validation
➤ YN0002: │ medusa-b2b-starter@workspace:. doesn't provide tailwindcss (p2527c), requested by @medusajs/ui-preset.
➤ YN0086: │ Some peer dependencies are incorrectly met by your project; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 261ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done with warnings in 0s 563ms
? Enter the database name medusa-db
info:    Connection established with the database "medusa-db"
info:    Created database "medusa-db"
info:    Updated .env file with "DB_NAME=medusa-db"
redisUrl not found. A fake redis instance will be used.
info:    Running migrations...
error:   Key customer_group_id is not linkable on service customer
Error: Key customer_group_id is not linkable on service customer

Link to reproduction repo

https://github.com/medusajs/b2b-starter-medusa

@nicoladistefano nicoladistefano added the bug Something isn't working label Mar 15, 2025
@kumarjai1
Copy link

I have the exact same issue - trying to understand how to fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants