Fail to build my cockpit

Product/components used and version/fix level:

Cumulocity UI 1016.0.214

Detailed explanation of the problem:

Fail to build my cockpit.
This cockpit is to enable anonymous access and customize branding.
It’s working access the application locally with command ‘npm start’.
But fail to build the package.

Error messages / full error message screenshot / log file:

ERROR in node_modules/@types/ws/index.d.ts:328:18 - error TS2315: Type ‘Server’ is not generic.

328 server?: HTTPServer | HTTPSServer | undefined;
~~~~~~~~~~~~~

ERROR in node_modules/@types/ws/index.d.ts:328:34 - error TS2315: Type ‘Server’ is not generic.

328 server?: HTTPServer | HTTPSServer | undefined;
~~~~~~~~~~~~~~

webpack 5.76.1 compiled with 2 errors and 1 warning in 128497 ms (c1dd1a14e75419bb43e4)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cockpit-anonymous@1.0.0 build: c8ycli build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cockpit-anonymous@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Question related to a free trial, or to a production (customer) instance?

Hi,

you can set skipLibCheck to true in your tsconfig.json under compilerOptions.
Newer fix versions of 1016 include this by default when scaffolding an application using the c8ycli.

If you would have scaffolded the latest fix version using:

c8ycli new cockpit cockpit -a @c8y/apps@1016.0.324

skipLibCheck should have been set to true already.

1 Like

Thanks Tristan, your suggestion is working.
One more question, how to build the zip package including custom branding.less ?

If you need to have a zip file to deploy via UI, you would have to zip the contents of dist/apps/cockpit (the cumulocity.json and index.html files should be in the root of the zip file along with a lot more files if you did everything correct).

The branding.less file should be defined under the brandingEntry ApplicationOption in the package.json or you define the brandingEntry via CLI parameters when serving/building the app as described here.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.