# UI fails to compile - Bug?

**URL:** <https://community.openems.io/t/ui-fails-to-compile-bug/5509>\
**Category:** Software-Development\
**Created:** [January 8, 2025, 6:30am UTC](https://community.openems.io/t/ui-fails-to-compile-bug/5509 "2025-01-08T06:30:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sn0w3y](https://community.openems.io/user_avatar/community.openems.io/sn0w3y/32/636_2.png) [@Sn0w3y](https://community.openems.io/u/Sn0w3y)\
**Post date:** [January 8, 2025, 6:30am UTC](https://community.openems.io/t/ui-fails-to-compile-bug/5509/1 "2025-01-08T06:30:35Z")

</div>

Hello,

since yesterday my UI Build fails. Can someone reproduce this Issue?

× Failed to compile.  
✔ Browser application bundle generation complete.

66 unchanged chunks

Build at: 2025-01-08T06:28:30.993Z - Hash: c915a44ab19f3024 - Time: 6673ms

Error: node\_modules/uuid/dist/cjs/parse.d.ts:1:39 - error TS2315: Type ‘Uint8Array’ is not generic.

1 declare function parse(uuid: string): Uint8Array;  
~~~~~~~~~~~~~~~~~~~~~~~

Error: node\_modules/uuid/dist/cjs/v35.d.ts:2:53 - error TS2315: Type ‘Uint8Array’ is not generic.

2 export declare function stringToBytes(str: string): Uint8Array;  
~~~~~~~~~~~~~~~~~~~~~~~

Error: node\_modules/uuid/dist/cjs/v35.d.ts:6:166 - error TS2315: Type ‘Uint8Array’ is not generic.

6 export default function v35(version: 0x30 | 0x50, hash: HashFunction, value: string | Uint8Array, namespace: UUIDTypes, buf?: Uint8Array, offset?: number): string | Uint8Array;

```
                                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~

```

× Failed to compile.

---

<div class="post-metadata">

**Author:** ![stefan.feilmeier](https://community.openems.io/user_avatar/community.openems.io/stefan.feilmeier/32/2585_2.png) [@stefan.feilmeier](https://community.openems.io/u/stefan.feilmeier)\
**Post date:** [January 8, 2025, 3:38pm UTC](https://community.openems.io/t/ui-fails-to-compile-bug/5509/2 "2025-01-08T15:38:48Z")

</div>

See discussion at

> <https://github.com/OpenEMS/openems/issues/2959>
>
> \### Description
> 
> \## \*\*Description\*\*
> When attempting to build the Angular projec…t, the TypeScript compiler fails due to incorrect usage of \`Uint8Array\` in the type definitions of the \`uuid\` package. The errors indicate that \`Uint8Array\` is being treated as a generic type, which is invalid in TypeScript.
> 
> \---
> 
> \## \*\*Error Details\*\*
> \`\`\`
> × Failed to compile.
> ✔ Browser application bundle generation complete.
> 
> 66 unchanged chunks
> 
> Build at: 2025-01-08T06:28:30.993Z - Hash: c915a44ab19f3024 - Time: 6673ms
> 
> Error: node\_modules/uuid/dist/cjs/parse.d.ts:1:39 - error TS2315: Type ‘Uint8Array’ is not generic.
> 
> 1 declare function parse(uuid: string): Uint8Array;
> ~~~~~~~~~~~~~~~~~~~~~~~
> 
> Error: node\_modules/uuid/dist/cjs/v35.d.ts:2:53 - error TS2315: Type ‘Uint8Array’ is not generic.
> 
> 2 export declare function stringToBytes(str: string): Uint8Array;
> ~~~~~~~~~~~~~~~~~~~~~~~
> 
> Error: node\_modules/uuid/dist/cjs/v35.d.ts:6:166 - error TS2315: Type ‘Uint8Array’ is not generic.
> 
> 6 export default function v35(version: 0x30 | 0x50, hash: HashFunction, value: string | Uint8Array, namespace: UUIDTypes, buf?: Uint8Array, offset?: number): string | Uint8Array;
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> × Failed to compile.
> \`\`\`
> \---
> 
> \## \*\*Expected Behavior\*\*
> The Angular project should compile successfully without TypeScript errors related to the \`uuid\` package, resulting in a build output in the specified \`www\` directory.
> 
> \---
> 
> \## \*\*Environment\*\*
> \- \*\*Operating System:\*\* Windows
> \- \*\*Node.js Version:\*\* Node20
> \- \*\*TypeScript Version:\*\* 5.6.3
> \- \*\*Angular Version:\*\* v19
> \- \*\*uuid Package Versions:\*\*
> - \`uuid@7.0.3\` via \`xcode@3.0.1\`
> - \`uuid@8.3.2\` via \`webpack-dev-server@5.1.0\`
> - \`uuid@11.0.4\` directly in the project
> 
> \---
> 
> \## \*\*Additional Information\*\*
> \- \*\*Deprecated Packages Warnings:\*\*
> - Multiple deprecated packages are being used, such as \`sourcemap-codec@1.4.8\`, \`inflight@1.0.6\`, \`glob@7.2.3\`, \`q@1.5.1\`, \`@xmldom/xmldom@0.7.13\`, \`superagent@8.1.2\`, and \`rimraf@2.7.1 & 3.0.2\`.
>   
> \- \*\*Potential Conflicts:\*\*
> - Multiple versions of the \`uuid\` package might be causing type definition conflicts.
>   
> \- \*\*Temporary Workaround Applied:\*\*
> - Added \`"skipLibCheck": true\` to \`tsconfig.json\` to bypass type checking of declaration files, allowing the build to proceed.
> 
> \---
> 
> \## \*\*Possible Solutions Attempted\*\*
> 1. \*\*Skipped Library Type Checking:\*\*
> - Modified \`tsconfig.json\` to include:
> \`\`\`json
> {
> "compilerOptions": {
> // ... other options ...
> "skipLibCheck": true
> }
> }
> \`\`\`
> - \*\*Result:\*\* Build succeeded without TypeScript errors, but this masks underlying type issues.
> 
> 2. \*\*Attempted to Align \`uuid\` Package Versions:\*\*
> - Considered using the \`overrides\` field in \`package.json\` to force a single \`uuid\` version.
> - \*\*Challenges:\*\* Potential incompatibilities with dependencies expecting different \`uuid\` versions.
> 
> 3. \*\*Explored Updating or Patching Affected Packages:\*\*
> - Identified that \`webpack-dev-server@5.1.0\` and \`xcode@3.0.1\` depend on older \`uuid\` versions.
> - \*\*Next Steps:\*\* Check for updates to these packages or consider patching their dependencies.
> 
> \---
> 
> \## \*\*References\*\*
> \- \*\*npm Package:\*\* \[\[uuid on npm\](https://www.npmjs.com/package/uuid)\](https://www.npmjs.com/package/uuid)
> \- \*\*TypeScript Error TS2315:\*\* \[\[TypeScript Handbook - Error Messages\](https://www.typescriptlang.org/docs/handbook/compiler-options.html)\](https://www.typescriptlang.org/docs/handbook/compiler-options.html)
> \- \*\*Angular Build Documentation:\*\* \[\[Angular CLI - ng build\](https://angular.io/cli/build)\](https://angular.io/cli/build)
> 
> 
> See here:
> 
> https://github.com/uuidjs/uuid/issues/856
> 
> \### Screenshots
> 
> \_No response\_
> 
> \### Operating System
> 
> \_No response\_
> 
> \### How to reproduce the Error?
> 
> \## \*\*Steps to Reproduce\*\*
> 1. \*\*Clone the Repository:\*\*
> \`\`\`bash
> git clone https://github.com/OpenEMS/OpenEMS.git
> cd OpenEMS/ui
> \`\`\`
> 
> 2. \*\*Clean Install Dependencies:\*\*
> \`\`\`bash
> rm -rf node\_modules package-lock.json
> npm cache clean --force
> npm install --legacy-peer-deps
> \`\`\`
> 
> 3. \*\*Run Build:\*\*
> \`\`\`bash
> npx ng build -c "openems,openems-backend-prod,prod" --output-path=www
> \`\`\`

No solution yet, though.

---

<div class="post-metadata">

**Author:** ![Sn0w3y](https://community.openems.io/user_avatar/community.openems.io/sn0w3y/32/636_2.png) [@Sn0w3y](https://community.openems.io/u/Sn0w3y)\
**Post date:** [January 8, 2025, 4:35pm UTC](https://community.openems.io/t/ui-fails-to-compile-bug/5509/3 "2025-01-08T16:35:44Z")

</div>

I fixed it by removing the ^ before 10.0.3 in uuid.

Are there others who have these issue on clean installation?

npm install

If yes i would provide a PR.

Greetings !

---

<div class="post-metadata">

**Author:** ![stefan.feilmeier](https://community.openems.io/user_avatar/community.openems.io/stefan.feilmeier/32/2585_2.png) [@stefan.feilmeier](https://community.openems.io/u/stefan.feilmeier)\
**Post date:** [January 9, 2025, 1:27pm UTC](https://community.openems.io/t/ui-fails-to-compile-bug/5509/4 "2025-01-09T13:27:53Z")

</div>

This does not ‘solve’ the issue as it just tells package.json to stay with exactly “10.0.3”. To solve the issue, we would have to fix the PR above.

If you have a build error locally, try running `npm ci` instead of `npm install`.

> <https://stackoverflow.com/questions/52499617/what-is-the-difference-between-npm-install-and-npm-ci>

---

<div class="post-metadata">

**Author:** ![Sn0w3y](https://community.openems.io/user_avatar/community.openems.io/sn0w3y/32/636_2.png) [@Sn0w3y](https://community.openems.io/u/Sn0w3y)\
**Post date:** [January 10, 2025, 3:06am UTC](https://community.openems.io/t/ui-fails-to-compile-bug/5509/5 "2025-01-10T03:06:29Z")

</div>

11.0.5 fixes it 🙂 Package uuid again working
