Rebolon
Rebolon

Reputation: 1307

Using Clarity Core components with vanilla JS fails because of imports problem

Clarity from VMWare is a design system usable by Angular or by Vanilla JS. I'm used to build application with the Angular version, but now i need to use Clarity in an HTML/vanilla Js application. The problem is that when i follow the documentation, the import of the web components is always failing : Uncaught TypeError: Failed to resolve module specifier "@cds/core/icon/register.js". Relative references must start with either "/", "./", or "../".

I create a stacklitz project to display a simple button, but it's not rendered at all

https://stackblitz.com/edit/stackblitz-starters-k3kbl2?file=index.html

Open the console and see the javascript error

Upvotes: 0

Views: 38

Answers (1)

Rebolon
Rebolon

Reputation: 1307

To use Clarity web components, you need to use a JS bundler (it's not in the official documentation). You can use Webpack, RollUp, Vite, whatever.

Upvotes: 0

Related Questions