Critical Issue: Velo Backend Module Resolution Failure for @wix/ecom-orders (Cannot find module / Not declared in dependencies)

Hello Wix Velo Community and Support,

I am experiencing a critical issue with my Wix Velo backend code that is preventing a core automation from functioning. I have thoroughly investigated this on my end and believe it points to a problem within the Velo runtime environment or its package management system.


1. Business Goal & Automation Overview:

I am developing an automation on my Wix website, https://www.dumiere.com/. Its purpose is to:

  • Receive a webhook notification from Wix Automations (Events: New Order) which sends the checkoutId to my custom HTTP Function (backend/http-functions.js).
  • Using this checkoutId, access the Wix API (specifically the orders module) to retrieve full order details (customer name, address, product info, etc.).
  • Process the retrieved data and send an HTTP GET request with relevant details to an external shipping system (YDM).
  • Return an appropriate response to Wix Automations.

2. Steps Taken & Current State:

I have performed the following steps:

  • Wix Automation Setup: Configured an automation to send the checkoutId to my post_sendToYDMapi HTTP Function.
  • Backend Code Development: Wrote the code in backend/http-functions.js to receive the webhook, and attempt to fetch order details using orders.getOrder(checkoutId).
  • Module Installation & Import Attempts:
    • Initially, I tried importing from wix-ecom-backend/orders and @wix/stores-backend.
    • After encountering “Cannot find module” errors, I checked the Wix Package Manager (both “Velo” and “npm” tabs).
    • I identified the correct package for e-commerce orders as @wix/ecom-orders (with a hyphen).
    • My current import statement is: import { orders } from '@wix/ecom-orders';
    • The package @wix/ecom-orders (version 1.0.193) is clearly listed as installed under the npm tab in my Wix Package Manager. (I will attach a screenshot.)
  • Deployment & Logging: I have published the site after every code or package change and meticulously checked the logs in Wix Developer Tools.

3. The Persistent Problem:

Despite @wix/ecom-orders being installed and correctly imported in the code, I consistently receive the following error in the logs when the HTTP Function is triggered:

JSON{ "insertId": "..........49U9Itrv4.zd5YcpAhGfyq", "timestamp": "2025-06-09T10:12:02.498Z", "labels": { "siteUrl": "https://www.dumiere.com/", "revision": "1765", "namespace": "Velo", "tenantId": "5dde50d7-e1ac-437e-9f5c-40461d60f602", "viewMode": "Site" }, "operation": { "id": "1749463922.0316264675786662774", "producer": "backend" }, "jsonPayload": { "message": "Error loading web module backend/http-functions.js: Both resolutions failed at _load!\n[]\nOriginal resolver: Both resolutions failed at _load!\n[]\nOriginal resolver: Cannot find module '@wix/ecom-orders'\nRequire stack:\n- /user-code/backend/http-functions.js\n- /user-code/stubmodule-that-does-the-require.js\n- /cloud-runtime-code/node_modules/scoped-require/index.js\n- /cloud-runtime-code/packages/elementory/cloud-runtime/factories.js\n- /cloud-runtime-code/packages/elementory/cloud-runtime/create-app.js\n- /cloud-runtime-code/packages/elementory/cloud-runtime/cloud-grid-runner.js\nYarnPNP: Both resolutions failed at _resolveFilename!\n[{\"moduleFunctionName\":\"_load\",\"codePath\":\"yarnPNP\",\"request\":\"@wix/ecom-orders\"},{\"moduleFunctionName\":\"_resolveFilename\",\"codePath\":\"yarnPNP\",\"request\":\"@wix/ecom-orders\"}]\nOriginal resolver: Cannot find module '@wix/ecom-orders'\nRequire stack:\n- /user-code/backend/http-functions.js\n- /user-code/stubmodule-that-does-the-require.js\n- /cloud-runtime-code/node_modules/scoped-require/index.js\n- /cloud-runtime-code/packages/elementory/cloud-runtime/factories.js\n- /cloud-runtime-code/packages/elementory/cloud-runtime/create-app.js\n- /cloud-runtime-code/packages/elementory/cloud-runtime/cloud-grid-runner.js\nYarnPNP: Your application tried to access @wix/ecom-orders, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.\n\nRequired package: @wix/ecom-orders\nRequired by: /user-code/backend/\n\nRequire stack:\n- /user-code/backend/http-functions.js\n- /user-code/stubmodule-that-does-the-require.js\n- /cloud-runtime-code/node_modules/scoped-require/index.js\n- /cloud-runtime-code/packages/elementory/cloud-runtime/factories.js\n- /cloud-runtime-code/packages/elementory/cloud-runtime/create-app.js\n- /cloud-runtime-code/packages/elementory/cloud-runtime/cloud-grid-runner.js\nYarnPNP: Both resolutions failed at _load!\n[]\nOriginal resolver: Cannot find module '@wix/ecom-orders'\nRequire stack:\n- /user-code/backend/http-functions.js\n- /user-code/stubmodule-that-does-the-require.js\n- /cloud-runtime-code/node_modules/scoped-require/index.js\n- /cloud-runtime-code/packages/elementory/cloud-runtime/factories.js\n- /cloud-runtime-code/packages/elementory/cloud-runtime/create-app.js\n- /cloud-runtime-code/packages/elementory/cloud-runtime/cloud-grid-runner.js\nYarnPNP: Both resolutions failed at _resolveFilename!\n[{\"moduleFunctionName\":\"_load\",\"codePath\":\"yarnPNP\",\"request\":\"@wix/ecom-orders\"},{\"moduleFunctionName\":\"_resolveFilename\",\"codePath\":\"yarnPNP\",\"request\":\"@wix/ecom-orders\"}]\nOriginal resolver: Cannot find module '@wix/ecom-orders'\nRequire stack:\n- /user-code/backend/http-functions.js\n- /user-code/stubmodule-that-does-the-require.js\n- /cloud-runtime-code/node_modules/scoped-require/index.js\n- /cloud-runtime-code/packages/elementory/cloud-runtime/factories.js\n- /cloud-runtime-code/packages/elementory/cloud-runtime/create-app.js\n- /cloud-runtime-code/packages/elementory/cloud-runtime/cloud-grid-runner.js\nYarnPNP: Your application tried to access @wix/ecom-orders, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.\n\nRequired package: @wix/ecom-orders\nRequired by: /user-code/backend/\n\nRequire stack:\n- /user-code/backend/http-functions.js\n- /user-code/stubmodule-that-does-the-require.js\n- /cloud-runtime-code/node_modules/scoped-require/index.js\n- /cloud-runtime-code/packages/elementory/cloud-runtime/factories.js\n- /cloud-runtime-code/packages/elementory/cloud-runtime/create-app.js\n- /cloud-runtime-code/packages/elementory/cloud-runtime/cloud-grid-runner.js" }, "severity": "ERROR", "receiveTimestamp": "2025-06-09T10:12:02.561Z", "id": "4b36e418-6196-4a20-86e4-4a4884b81e89" }

This error explicitly states: “Cannot find module ‘@wix/ecom-orders’” and that it “isn’t declared in your dependencies.” This prevents my backend code from executing at all.


4. My Conclusion & Request:

Given that the package is correctly installed via the Wix Package Manager and the import statement is correct, I conclude that the issue is not with my code, but with the Wix Velo runtime environment’s ability to resolve or load the installed @wix/ecom-orders package. It appears to be a deeper environmental or dependency management (YarnPNP) problem.

I kindly request urgent assistance from the Wix Velo team or experienced community members to investigate this module resolution failure. This issue is critical for my e-commerce automation.


Attachments for Reference:

  • Full backend/http-functions.js Code: (Please copy/paste the updated code I provided earlier, including the wix-http-functions imports.)
  • Screenshot of Wix Package Manager (npm tab): Showing @wix/ecom-orders installed.
  • Full Latest Log: (The JSON log provided above, indicating the “Cannot find module” error.)
  • Website URL: https://www.dumiere.com/

Thank you for your time and assistance!

Just a thought, but have you tried uninstalling the package and re-installing ? It seems everything else should be working

maybe try a clean test to see if the import is broken.

import { orders } from '@wix/ecom-orders';

export function test() {
  console.log("Orders module loaded", orders);
}

Hi Ofek!

It’s a bit difficult for the devs to pinpoint the issue since it’s not easily reproduced. If re-installing the package didn’t work, we might need some additional details.

If you could provide the failing request ID, it would help a lot with debugging efforts. You can find this in inspect element > Network tab > click on the failing request > and copy the x-wix-request-id under Headers.

Let me know if you’re able to find this, or you can add that information to a bug report ticket.

1 Like