Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#16535·medusa

[Bug]: custom path aliases breaks plugin dev hot reload

Author: SalahAdDinCreated Aug 21, 2026Updated Sep 16, 2026
Labelstype: bugstatus: needs triagingversion: 2.0help-wanted

Package.json file

json
{
  "name": "@vicacha-devs/medusa-plugin-b2b",
  "version": "0.0.1",
  "description": "B2B commerce capabilities for Medusa v2: companies, employees, quotes, approvals, spending limits, and B2B cart workflows.",
  "author": "Vicacha Devs",
  "license": "MIT",
  "files": [
    ".medusa/server",
    "src",
    "README.md",
    "LICENSE",
    "tsconfig.json"
  ],
  "exports": {
    "./package.json": "./package.json",
    "./workflows": "./.medusa/server/src/workflows/index.js",
    "./.medusa/server/src/modules/*": "./.medusa/server/src/modules/*/index.js",
    "./modules/*": "./.medusa/server/src/modules/*/index.js",
    "./providers/*": "./.medusa/server/src/providers/*/index.js",
    "./*": "./.medusa/server/src/*.js",
    "./admin": {
      "import": "./.medusa/server/src/admin/index.mjs",
      "require": "./.medusa/server/src/admin/index.js",
      "default": "./.medusa/server/src/admin/index.js"
    }
  },
  "keywords": [
    "medusa",
    "plugin",
    "medusa-plugin-b2b",
    "medusa-plugin",
    "medusa-plugin-other",
    "medusa-v2"
  ],
  "scripts": {
    "build": "medusa plugin:build",
    "publish:local": "medusa plugin:publish",
    "dev": "medusa plugin:develop",
    "lint": "medusa lint",
    "prepublishOnly": "medusa plugin:build",
    "test": "pnpm test:unit && pnpm test:integration:modules && pnpm test:integration:http",
    "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",
    "clean": "rm -rf .medusa node_modules"
  },
  "devDependencies": {
    "@hookform/resolvers": "5.7.1",
    "@medusajs/admin-sdk": "2.18.0",
    "@medusajs/admin-shared": "2.18.0",
    "@medusajs/cli": "2.18.0",
    "@medusajs/core-flows": "2.18.0",
    "@medusajs/dashboard": "2.18.0",
    "@medusajs/framework": "2.18.0",
    "@medusajs/icons": "2.18.0",
    "@medusajs/js-sdk": "2.18.0",
    "@medusajs/medusa": "2.18.0",
    "@medusajs/test-utils": "2.18.0",
    "@medusajs/types": "2.18.0",
    "@medusajs/ui": "4.2.0",
    "@radix-ui/react-popover": "1.1.23",
    "@radix-ui/react-radio-group": "1.4.7",
    "@radix-ui/react-slot": "1.3.3",
    "@swc/core": "1.7.28",
    "@tanstack/react-table": "8.20.5",
    "@types/node": "20.0.0",
    "@types/react": "18.3.2",
    "@types/react-dom": "18.2.25",
    "cmdk": "1.1.1",
    "date-fns": "4.4.0",
    "jiti": "2.0.0",
    "lodash": "4.18.1",
    "prop-types": "15.8.1",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "ts-node": "10.9.2",
    "tsc-alias": "^1.9.2",
    "typescript": "5.6.2",
    "vite": "5.2.11"
  },
  "peerDependencies": {
    "@medusajs/admin-sdk": "2.18.0",
    "@medusajs/admin-shared": "2.18.0",
    "@medusajs/core-flows": "2.18.0",
    "@medusajs/framework": "2.18.0",
    "@medusajs/icons": "2.18.0",
    "@medusajs/js-sdk": "2.18.0",
    "@medusajs/medusa": "2.18.0",
    "@medusajs/types": "2.18.0",
    "@medusajs/ui": "4.2.0",
    "@tanstack/react-table": "8.20.5",
    "@uiw/react-json-view": "2.0.0-alpha.43",
    "react-hook-form": "7.85.0",
    "zod": "4.4.3"
  },
  "engines": {
    "node": ">=20"
  },
  "packageManager": "[email protected]"
}

Node.js version

v25.9.0

Database and its version

PostgreSQL 16

Operating system name and version

Deepin 25

Browser name

Firefox

What happended?

We enabled the path aliases for our plugin.

We linked our plugin to our project (consuming app), and we tested it.

When we consume the plugin and it executes the dev command, it is unable to run the Admin ought to failure on the import paths because they are not being parsed in real time.

Expected behavior

It should work normally, and the documentation says so.

Actual behavior

We need to build the plugin, remove the node modules and cache in the consuming app, reinstall dependencies, and launch the system again so we can get the admin working again.

Also, we have to refresh the browser many times to get the changes made to the plugin.

As you can see, it is annoying.

Link to reproduction repo

https://github.com/Vicacha-Devs/vicacha-medusa-plugins

Source: medusajs/medusa

View original on GitHubView discussion on GitHub