Skip to content
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

Error: Workflow with id "create-product-variants" and step definition already exists. #7105

Open
Garnett1314 opened this issue Apr 20, 2024 · 10 comments

Comments

@Garnett1314
Copy link

I have a problem, I was developing a custom payment plugin, plugin dependency: @medusajs/medusa. then I compiled it and passed it, so I ran npm install my custom payment plugin under my medusa BACKEND_PATH, the installation was successful, then my yarn run start reported an error:
error: Error starting server
Error: Workflow with id "create-product-variants" and step definition already exists. at WorkflowManager.register
at WorkflowManager.register (/root/ws/node_modules/@medusajs/orchestration/dist/workflow/workflow-manager.js:36:23)
at Object. (/root/medusa-payment-custom/node_modules/@medusajs/core-flows/dist/definition/product/create-product-variants .js:89:33)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at Object. (/root/medusa-payment-custom/node_modules/@medusajs/core-flows/dist/definition/product/index.js:30:46)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
error Command failed with exit code 1

@jamcalli
Copy link

I am experiencing the exact same issue. Did you manage to resolve?

@nyctonio
Copy link

i am also getting the same error

@carlos-r-l-rodrigues
Copy link
Contributor

carlos-r-l-rodrigues commented Apr 30, 2024

Do you mind sharing your package.json dependencies?
this is very likely a version issue where 2 different definitions of the same workflow are being exported.

@nyctonio
Copy link

  "dependencies": {
    "@medusajs/admin": "latest",
    "@medusajs/cache-inmemory": "latest",
    "@medusajs/cache-redis": "latest",
    "@medusajs/event-bus-local": "latest",
    "@medusajs/event-bus-redis": "latest",
    "@medusajs/file-local": "latest",
    "@medusajs/medusa": "latest",
    "@tanstack/react-query": "4.22.0",
    "body-parser": "^1.19.0",
    "cors": "^2.8.5",
    "dotenv": "16.3.1",
    "express": "^4.17.2",
    "medusa-fulfillment-manual": "latest",
    "medusa-interfaces": "latest",
    "medusa-payment-manual": "latest",
    "medusa-payment-stripe": "latest",
    "prism-react-renderer": "^2.0.4",
    "typeorm": "^0.3.16"
  },
  "devDependencies": {
    "@babel/cli": "^7.14.3",
    "@babel/core": "^7.14.3",
    "@babel/preset-typescript": "^7.21.4",
    "@medusajs/medusa-cli": "latest",
    "@stdlib/number-float64-base-normalize": "0.0.8",
    "@types/express": "^4.17.13",
    "@types/jest": "^27.4.0",
    "@types/node": "^17.0.8",
    "babel-preset-medusa-package": "^1.1.19",
    "cross-env": "^7.0.3",
    "eslint": "^6.8.0",
    "jest": "^27.3.1",
    "rimraf": "^3.0.2",
    "ts-jest": "^27.0.7",
    "ts-loader": "^9.2.6",
    "typescript": "^4.5.2",
    "@types/mime": "1.3.5"
  },

@carlos-r-l-rodrigues
Copy link
Contributor

did you try removing your node_modules folder, yarn.lock file and reinstalling it again?

@nyctonio
Copy link

nope it didn't help

@jamcalli
Copy link

I was able to resolve my issue. I was spacing on running dev specifying the preserve symlinks.

npm run dev -- -- --preserve-symlinks

This made my error go away. When running just npm run dev I get the same error.

@carlos-r-l-rodrigues
Copy link
Contributor

@nyctonio could you please try that again using the lastest (1.20.5) version?

@dtduong30
Copy link

@nyctonio could you please try that again using the lastest (1.20.5) version?

Are you suggesting upgrading @medusajs/medusa to version 1.20.5 in the package.json?

@carlos-r-l-rodrigues
Copy link
Contributor

Are you suggesting upgrading @medusajs/medusa to version 1.20.5 in the package.json

any version from 1.20.5 and beyond. at the time of writing the latest was it.
it should not throw this error anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants