Skip to main content

Troubleshooting

API Token is required​

Error: API Token is required.
Error: API Base URL is required.

new ProductConfigurator() got an empty apiToken or apiBaseUrl. Check that your .env file exists and that its variable names start with VITE_, then restart the development server: Vite reads .env only when it starts.

The product could not be loaded​

The configurator reports the ERROR status, and the console shows no error. The reason is in the response of the Expivi API. Open your browser's developer tools, go to the Network tab, reload the page and look for a failed request to the API, such as /view/product-offers/…. Its response explains the problem. Common causes:

  • The locale is not enabled for your team. The response says, for example, The locale en-gb is not supported by this team. Use a locale that is enabled for your team, or leave out the locale option.
  • The product ID is wrong, or the product belongs to another team than the API token.
  • The API token is wrong or expired.
  • The apiBaseUrl points to another Expivi environment than the one your token and product are from.

Failed to fetch dynamically imported module​

TypeError: Failed to fetch dynamically imported module: …/xpv-layout-composer.entry.js
Error: Constructor for "xpv-layout-composer#undefined" was not found

You register the web components from a …/loader entry point, such as @expivi/sdk/ui-composer/loader. The loaders load each component from a separate file at runtime, and a bundler doesn't include those files. Import from …/components instead:

import { defineCustomElements } from '@expivi/sdk/ui-composer/components';

Product configurator is not initialized​

Error: Product configurator is not initialized.

You added an Expivi element, such as <xpv-layout-composer>, or called a use… function before the product was loaded. Wait for the READY status first. See Render the components once the configurator is ready.

The specifier "@expivi/sdk" was a bare specifier​

TypeError: The specifier "@expivi/sdk" was a bare specifier, but was not remapped to anything.
TypeError: Failed to resolve module specifier "@expivi/sdk".

The browser loaded your source files instead of the build. This happens when you open the project's index.html directly or serve the project folder. Use npm run dev during development, and deploy the contents of dist after npm run build.

Expivi Viewer not found​

Error: Expivi Viewer not found.

The 3D viewer script is missing. Add it to the <head> of your page, before your own scripts:

<script src="https://assets.expivi.net/viewer/latest/viewer.js"></script>

The viewer is empty or has no height​

The visualizer fills its parent element. Give the parent a height, and make the visualizer fill it:

.product-page__viewer {
height: 70vh;
}

.product-page__viewer xpv-product-visualizer {
display: block;
width: 100%;
height: 100%;
}

If the product has no visualization set up in Expivi, the visualizer has nothing to show.

The components have no styles​

  • Import the theme: import '@expivi/sdk/theme/style.css';.
  • Put <xpv-layout-composer> inside an element with the data-xpv-theme-prefix attribute. The theme only applies inside such elements.

My own buttons and headings lost their styles​

Your elements are inside an element with data-xpv-theme-prefix. The theme's CSS reset applies there. Move the attribute to the containers of the Expivi components only. See How the theme is scoped.

My theme variables have no effect​

The theme defines its variables on every element with data-xpv-theme-prefix, so values on :root or a parent element are overridden. Target those elements with a more specific selector, such as .brand-theme [data-xpv-theme-prefix]. See Adjust the theme with CSS variables.

Vue: Failed to resolve component: xpv-…​

[Vue warn]: Failed to resolve component: xpv-layout-composer

Vue treats <xpv-…> tags as Vue components. Add isCustomElement: (tag) => tag.startsWith('xpv-') to the compiler options of the Vue plugin. See Add Expivi to a web page.

React: the configurator isn't passed to the element​

The element gets configurator="[object Object]" as an attribute instead of the object as a property. Use React 19, and register the web components before your first render, so React knows that the element has a configurator property.

The request-quote button doesn't show​

No quote request is set up for the product in Expivi. The quote controller's isVisible is then false, and <xpv-request-quote> renders nothing.

The price is 0 or the BOM is empty​

No prices or bill of materials are set up for the product in Expivi. For a bundle, the price and BOM are also empty until the shopper adds a product.