SGFGOV / medusa-plugin-shopify-ts

Typescirpt version of the popular shopify importer plugin
MIT License
1 stars 1 forks source link

I tried to run full implementation of example but service not working. #5

Open muke5hy opened 10 months ago

muke5hy commented 10 months ago

I create a file post-startup-action-service.ts in services directory, and added code snippet of class PostStartupActionService which is in Readme file.

My expectation was it will execute and fetch products from Shopify but it failed. What I am doing wrong here?

What am I doing wrong here?

github-actions[bot] commented 10 months ago

Thank you for your contribution, much appreciated. A few small issues and we should be good to go

SGFGOV commented 10 months ago

No that is not the way it works. Your system needs to trigger the plugin by calling the import apis. Post startup actions is just one way.

Best Regards Govind Diwakar

On Thu, 12 Oct, 2023, 12:46 github-actions[bot], @.***> wrote:

Thank you for your contribution, much appreciated. A few small issues and we should be good to go

— Reply to this email directly, view it on GitHub https://github.com/SGFGOV/medusa-plugin-shopify-ts/issues/5#issuecomment-1759063784, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXEQJHBQMSHDWYIF5QOIRPTX66KMVANCNFSM6AAAAAA55ENTG4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

This message (including any attachments) may contain confidential, proprietary, privileged and/or private information. The information is intended to be for the use of the individual or entity designated above. If you are not the intended recipient of this message, please notify the sender immediately, and delete the message and any attachments. Any disclosure, reproduction, distribution or other use of this message or any attachments by an individual or entity other than the intended recipient is prohibited.   

muke5hy commented 10 months ago

Understood, Now I created custom route

router.get("/shopify", async (req, res) => {
    const service = req.scope.resolve("postStartupActionService")
    const result = await service.syncWithShopify();
    return res.json({ message: result })
  });

and triggering it, It completes the job but without storing any data in DB.
I am getting following errors and log in terminal.

How should I debug further.

// My config
{
    resolve: 'medusa-plugin-shopify-ts',
    options: {
      api_key: process.env.SHOPIFY_PASSWORD,
      store_domain: process.env.SHOPIFY_DOMAIN,
      default_store_name: 'Medusa Store'
    }
  },
error:   An error occurred while processing batch.confirmed: TypeError: Cannot read properties of null (reading 'id')
info:    Processing batch.updated which has 1 subscribers
info:    Processing batch.updated which has 1 subscribers
info:    Processing batch.failed which has 1 subscribers
info:    Processing batch.failed which has 1 subscribers
info:    Evaluating shopify-import batch_01HCHDVN5XGH3FWVFBG30BK9TV requested by usr_01HCCND1YR4NTA42SNM98EPV5N updated
error:   shopify-import batch_01HCHDVN5XGH3FWVFBG30BK9TV owner:  failed
error:   batch batch_01HCHDVN5XGH3FWVFBG30BK9TV requested by not found {}
info:    Evaluating shopify-import batch_01HCHDVPHK9N7DX2QZWQH096EK requested by usr_01HCCND1YR4NTA42SNM98EPV5N updated
error:   shopify-import batch_01HCHDVPHK9N7DX2QZWQH096EK owner:  failed
error:   batch batch_01HCHDVPHK9N7DX2QZWQH096EK requested by not found {}
info:    Shopfy Jobs Summary: Total Jobs: 58
    created: 0
    confirmed: 10
    processing: 0
    completed: 12,
    failed: 36 
SGFGOV commented 10 months ago

That is coz of the error..

Best Regards Govind Diwakar

On Thu, 12 Oct, 2023, 13:25 Mukesh Yadav, @.***> wrote:

Understood, Now I created custom route

router.get("/shopify", async (req, res) => { const service = req.scope.resolve("postStartupActionService") const result = await service.syncWithShopify(); return res.json({ message: result }) });

and triggering it, It completes the job but without storing any data in DB? I am getting following errors in and log in terminal.

error: An error occurred while processing batch.confirmed: TypeError: Cannot read properties of null (reading 'id') info: Processing batch.updated which has 1 subscribers info: Processing batch.updated which has 1 subscribers info: Processing batch.failed which has 1 subscribers info: Processing batch.failed which has 1 subscribers info: Evaluating shopify-import batch_01HCHDVN5XGH3FWVFBG30BK9TV requested by usr_01HCCND1YR4NTA42SNM98EPV5N updated error: shopify-import batch_01HCHDVN5XGH3FWVFBG30BK9TV owner: failed error: batch batch_01HCHDVN5XGH3FWVFBG30BK9TV requested by not found {} info: Evaluating shopify-import batch_01HCHDVPHK9N7DX2QZWQH096EK requested by usr_01HCCND1YR4NTA42SNM98EPV5N updated error: shopify-import batch_01HCHDVPHK9N7DX2QZWQH096EK owner: failed error: batch batch_01HCHDVPHK9N7DX2QZWQH096EK requested by not found {} info: Shopfy Jobs Summary: Total Jobs: 58 created: 0 confirmed: 10 processing: 0 completed: 12, failed: 36



—
Reply to this email directly, view it on GitHub
<https://github.com/SGFGOV/medusa-plugin-shopify-ts/issues/5#issuecomment-1759116878>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXEQJHFCB5ABGQG7X7V6CP3X66PARANCNFSM6AAAAAA55ENTG4>
.
You are receiving this because you commented.Message ID:
***@***.***>

--

This message (including any attachments) may contain confidential, proprietary, privileged and/or private information. The information is intended to be for the use of the individual or entity designated above. If you are not the intended recipient of this message, please notify the sender immediately, and delete the message and any attachments. Any disclosure, reproduction, distribution or other use of this message or any attachments by an individual or entity other than the intended recipient is prohibited.   

muke5hy commented 10 months ago

Any idea how I can debug the issue to resolve this? Or is there a way to get more details log with file information?

SGFGOV commented 10 months ago

Put a break point if your editor is setup inside the node modules / plugin folder

Best Regards Govind Diwakar

On Thu, 12 Oct, 2023, 14:01 Mukesh Yadav, @.***> wrote:

Any idea how I can debug the issue to resolve this? Or is there a way to get more details log with file information?

— Reply to this email directly, view it on GitHub https://github.com/SGFGOV/medusa-plugin-shopify-ts/issues/5#issuecomment-1759170531, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXEQJHCUBLHUGV4FPNB25KTX66THXANCNFSM6AAAAAA55ENTG4 . You are receiving this because you commented.Message ID: @.***>

--

This message (including any attachments) may contain confidential, proprietary, privileged and/or private information. The information is intended to be for the use of the individual or entity designated above. If you are not the intended recipient of this message, please notify the sender immediately, and delete the message and any attachments. Any disclosure, reproduction, distribution or other use of this message or any attachments by an individual or entity other than the intended recipient is prohibited.   

muke5hy commented 10 months ago

Not sure how to setup vscode in node_modules or plugin.

But I see following error too


error:   An error occurred while processing batch.created: Error: Unable to find a BatchJob strategy with the type shopify-import```
JackHull commented 10 months ago

I am experiencing the same error.

JackHull commented 10 months ago

@muke5hy Were you able to find a solution?