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 while syncing a printful Shop with multiple Variants #6

Open
stephane-segning opened this issue Nov 24, 2023 · 4 comments
Open

Comments

@stephane-segning
Copy link

stephane-segning commented Nov 24, 2023

Hello guys! Thank you for this awesome plugin! I'd like to contribute to it. I have this issue when I try to sync from my printful store to my medusa:

[medusa-plugin-printful]: There appeared an error trying to create '<Product name>' in Medusa:  Error: Product options length does not match variant options length. Product has 2 and variant has 0.
    at _loop_1 (/Users/selast/Developer/projects/vymalo-store/vymalo-store/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_medusa-in_7b45u327hy534hn34sxwnoh7au/node_modules/@medusajs/medusa/dist/services/product-variant.js:1153:23)
    at ProductVariantService.validateVariantsToCreate_ (/Users/selast/Developer/projects/vymalo-store/vymalo-store/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_medusa-in_7b45u327hy534hn34sxwnoh7au/node_modules/@medusajs/medusa/dist/services/product-variant.js:1173:17)
    at ProductVariantService.<anonymous> (/Users/selast/Developer/projects/vymalo-store/vymalo-store/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_medusa-in_7b45u327hy534hn34sxwnoh7au/node_modules/@medusajs/medusa/dist/services/product-variant.js:237:50)
    at step (/Users/selast/Developer/projects/vymalo-store/vymalo-store/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_medusa-in_7b45u327hy534hn34sxwnoh7au/node_modules/@medusajs/medusa/dist/services/product-variant.js:59:23)
    at Object.next (/Users/selast/Developer/projects/vymalo-store/vymalo-store/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_medusa-in_7b45u327hy534hn34sxwnoh7au/node_modules/@medusajs/medusa/dist/services/product-variant.js:40:53)
    at fulfilled (/Users/selast/Developer/projects/vymalo-store/vymalo-store/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_medusa-in_7b45u327hy534hn34sxwnoh7au/node_modules/@medusajs/medusa/dist/services/product-variant.js:31:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  type: 'invalid_data',
  code: undefined,
  date: 2023-11-24T10:11:50.707Z
}

with this config:

...
{
    resolve: "medusa-plugin-printful",
    options: {
      printfulAccessToken: process.env.PRINTFUL_ACCESS_TOKEN,
      storeId: process.env.PRINTFUL_STORE_ID,
      backendUrl: process.env.BACKEND_URL,
      redisURL: REDIS_URL, // <-- this one was not clear to guess. You should maybe update the doc
      enableWebhooks: process.env.NODE_ENV === "production",
      enableSync: true,
      productTags: true,
      // confirmOrder: true
    }
  },
...

And now the question is to know how this can be fixed.

Thank you in advance for any help

@alexookah
Copy link

I have the same problem:

[medusa-plugin-printful]: There appeared an error trying to create 'Short Sleeve T-Shirt' in Medusa:  Error: Product options length does not match variant options length. Product has 2 and variant has 0.
    at _loop_1 (/Users/alexookahbeast/Documents/github/medusajs-cwr-setup/medusa-backend/node_modules/@medusajs/medusa/dist/services/product-variant.js:1153:23)
    at ProductVariantService.validateVariantsToCreate_ (/Users/alexookahbeast/Documents/github/medusajs-cwr-setup/medusa-backend/node_modules/@medusajs/medusa/dist/services/product-variant.js:1173:17)
    at ProductVariantService.<anonymous> (/Users/alexookahbeast/Documents/github/medusajs-cwr-setup/medusa-backend/node_modules/@medusajs/medusa/dist/services/product-variant.js:237:50)
    at step (/Users/alexookahbeast/Documents/github/medusajs-cwr-setup/medusa-backend/node_modules/@medusajs/medusa/dist/services/product-variant.js:59:23)
    at Object.next (/Users/alexookahbeast/Documents/github/medusajs-cwr-setup/medusa-backend/node_modules/@medusajs/medusa/dist/services/product-variant.js:40:53)
    at fulfilled (/Users/alexookahbeast/Documents/github/medusajs-cwr-setup/medusa-backend/node_modules/@medusajs/medusa/dist/services/product-variant.js:31:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  type: 'invalid_data',
  code: undefined,
  date: 2023-12-30T13:59:09.912Z
}
Job failed with ID 11: undefined
TypeError: Cannot read properties of undefined (reading 'message')
    at handleFailed (/Users/alexookahbeast/Documents/github/medusajs-cwr-setup/medusa-backend/node_modules/bullmq/dist/cjs/classes/worker.js:316:29)
    at Worker.processJob (/Users/alexookahbeast/Documents/github/medusajs-cwr-setup/medusa-backend/node_modules/bullmq/dist/cjs/classes/worker.js:345:20)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Worker.retryIfFailed (/Users/alexookahbeast/Documents/github/medusajs-cwr-setup/medusa-backend/node_modules/bullmq/dist/cjs/classes/worker.js:524:24)

@Pimeq
Copy link

Pimeq commented Feb 9, 2024

Did you guys happen to figure it out? Im having the same issue sadly

@jamcalli
Copy link

Was anyone able to figure this one out?

@DelvLoping
Copy link

Hi guys, I have the same problem.

[medusa-plugin-printful]: Processing job #1 - [352574343] tesssst [medusa-plugin-printful]: There appeared an error trying to create 'tesssst' in Medusa:  Error: Product options length does not match variant options length. Product has 1 and variant has 0.

Did someone solve it?

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

No branches or pull requests

5 participants