I’m trying to use Get All Products on the WooCommerce node and it returns “ERROR: Cannot read property ‘split’ of undefined”
The message it returns:
TypeError: Cannot read property 'split' of undefined
at Object.woocommerceApiRequestAllItems (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/WooCommerce/GenericFunctions.js:47:44)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/WooCommerce/WooCommerce.node.js:253:40)
at async /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:447:47
I’m very sorry to hear you’re running into this problem. I’ll need to set up a WordPress instance and install WooCommerce to give this a go first hand and will report back once done. Just to make sure: You do have products added to your WooCommerce database, right?
On a more general note, when posting code like the JSON representation one of your workflow, would you be able to wrap it in a preformatted block by using this button (or by manually adding three backticks ``` above and below your snippet)?
This will help greatly with copying it as it will prevent the forum from applying any formatting (though in this case it’s not a real problem as this is not a very complex workflow ). I’ve also added these backticks to the question template to make it easier going forward.
Thanks @Alejandro_Bonnin, it’s quite helpful to see this is happening only for a larger amount of products. Based on this info I assume the problem would then only occur if the Return All option is enabled (as in your example workflow) but otherwise the node is working fine?
Maybe there’s a problem with the pagination logic then. I’ll insert some more products in my store next to see what happens.
I could not reproduce the exact error you have described though @Alejandro_Bonnin. The split method from the error trace you have shared refers to the response headers received from WooCommerce, which for some reason does not seem to be available in your example. I wonder if this might just be a side effect of the problem I have noticed.
Let me fix the pagination problem first, maybe this also addresses your issue
Is there anyway to manually implement this fix or an ETA on when it might get included in the current release? Finding it hard to finish a few of my projects and trying to figure out if I am better off working around it if it might be some time until it’s fixed?
I have just done a review / test internally and it all looks good so I have passed it to the next step to get merged. We have been spending a lot of time working on reviewing the community node improvement PRs and missed this one.
In theory this one should be included next week / the week after so to be safe lets aim for before the end of the month just incase anything else pops up.
I have the same problem. When I try to retrieve all users.
TypeError: Cannot read properties of undefined (reading 'split')
at Object.woocommerceApiRequestAllItems (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/WooCommerce/GenericFunctions.js:36:49)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/WooCommerce/WooCommerce.node.js:128:40)
at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:652:28)
I use version 0.233.1 of n8n, WP 6.2.2 and WOO 7.8.2