Digiverse

6 common Wix Velo errors and how to fix them

Short answer

Most Velo errors come from a few causes: running dataset code before the dataset has loaded, using a collection that doesn't exist or is named differently (WDE0025), missing collection permissions (WDE0027), mismatched element IDs, and calling backend code from a file the frontend can't reach. Each has a specific fix below.

These are the errors I see most often when clients send me a broken Wix site. They apply to Velo in the Wix Editor and in Wix Studio.

1. Dataset code runs before the data has loaded

Symptoms: getCurrentItem() returns nothing, a repeater stays empty, or you see "operation not allowed on an unconfigured dataset".

Cause: most dataset functions only work after the dataset has loaded its data. If you call them from the page's onReady(), the data may not be there yet.

Fix: wrap the call in the dataset's own onReady() handler, inside the page's onReady():

$w.onReady(function () {
  $w("#myDataset").onReady(() => {
    const item = $w("#myDataset").getCurrentItem();
    $w("#title").text = item.title;
  });
});

You only need this inside the page's onReady(). Code that runs later, such as a button click handler, can assume the dataset has already loaded. Also, don't put await in front of the dataset's onReady(), and don't chain .then() onto it: it's an event handler, not a promise.

2. WDE0025: the collection does not exist

Cause: the collection name in your code doesn't match a collection on the site. Common reasons are a typo, a different capitalisation, using the display name instead of the collection ID, or querying a Wix app collection with the wrong ID.

Fix: open the CMS, select the collection, and copy its exact ID from the collection settings. For app collections, such as Members or Stores, use the IDs listed in the Velo documentation rather than the names you see in the dashboard.

3. WDE0027: the current user doesn't have permission

Symptoms: everything works when you preview the site, but visitors see empty pages or failed form submissions.

Cause: in Preview you're treated as the site admin. Real visitors only get the permissions set on the collection.

Fix: don't open the collection to "Anyone" just to make the error go away, because that exposes your data. Instead, set the collection permissions to what visitors genuinely need. If visitors must trigger an action they shouldn't be able to do directly, move that code into a backend web method that checks who's calling, and run the data operation there.

4. "Cannot read properties of undefined" or "is not a function" on an element

Cause: the element ID in your code doesn't exist on the page. This happens after renaming an element, deleting it, copying code from another page, or when an element is hidden or removed on mobile.

Fix: click the element, check its ID in the properties panel, and update the code. The code panel underlines IDs it can't find on the page, so look for those warnings first.

5. Backend function can't be called from the page

Cause: plain .js files in the backend can only be called from other backend files. To call backend code from a page, it must be in a web module.

Fix: use a .web.js file and wrap the function in webMethod() with a permission level. The older .jsw web modules are deprecated, although existing ones keep working.

// backend/quotes.web.js
import { Permissions, webMethod } from "wix-web-module";

export const getQuote = webMethod(Permissions.Anyone, async (size) => {
  return size * 25;
});

// Page code
import { getQuote } from "backend/quotes.web";
$w.onReady(async () => {
  $w("#price").text = String(await getQuote(4));
});

Choose the strictest permission that works: Anyone, SiteMember or Admin. Note that backend console.log output doesn't appear in your browser console on the live site; use the site's logs instead.

6. Code works in Preview but not on the live site

Work through this list in order:

  • Did you publish after the last change? Preview shows unpublished code; the live site doesn't.
  • Collection permissions (see WDE0027 above).
  • Elements hidden or removed on mobile.
  • Exported event handlers that no longer match an element after renaming. Prefer attaching handlers in code, such as $w("#button1").onClick(...), inside onReady().
  • Browser caching. Test in a private window.

When to get help

If your site uses several datasets, backend code and app collections together, errors often interact, and fixing one exposes the next. That's the kind of job I take on most weeks, usually at a fixed price after looking at the code.

Sources

Have a project in mind?

Tell me what you need. You'll get a reply with next steps, usually within a day.