Superset add-on error when building the gradle running application

jmix version: 2.3.3
faced error on running the jmix onboarding project after installing superset add-on.
Error: e[31m[commonjs–resolver] Failed to resolve entry for package “@superset-ui/switchboard”. The package may have incorrect main/module/exports specified in its package.json.e[31m

Hello!

The Superset team publish empty lib to the NPM and it breaks the frontend compilation. See Failed to resolve entry for package "@superset-ui/switchboard". The package may have incorrect main/module/exports specified in its package.json. · Issue #30207 · apache/superset · GitHub

We should wait until they publish the correct sources to NPM. Fortunately, there is a workaround in Jmix. Create a class that extends com.vaadin.flow.component.Component and add the @NpmPackage annotation:

@NpmPackage(value = "@superset-ui/embedded-sdk", version = "0.1.0-alpha.12")
@NpmPackage(value = "@superset-ui/switchboard", version = "0.20.2")
public class NpmDependencies extends Component {
}
1 Like

Hi, thanks for your reply. but i wanted to know further where would i create the class in my project?

Anywhere under the base package path. For instance, for test purpose I placed this class here:

image

Thank you. it works. For future reference ,my new class :
package com.company.test;
import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.dependency.NpmPackage;
//import com.test.framework.NpmPackage; // Adjust based on the actual package location

@NpmPackage(value = “@superset-ui/embedded-sdk”, version = “0.1.0-alpha.10”)
@NpmPackage(value = “@superset-ui/switchboard”, version = “0.20.2”)
public class NpmDependencies extends Component {
}