Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harbor UI Development: npm start Fails to Compile #21044

Open
bupd opened this issue Oct 14, 2024 · 4 comments · May be fixed by #21153
Open

Harbor UI Development: npm start Fails to Compile #21044

bupd opened this issue Oct 14, 2024 · 4 comments · May be fixed by #21153

Comments

@bupd
Copy link
Contributor

bupd commented Oct 14, 2024

If you are reporting a problem, please make sure the following information are provided:

Expected behavior and actual behavior:

Expected behavior: The npm start or ng serve commands should run successfully to start the Harbor UI development server without any issues.

Actual behavior: Running npm start or ng serve results in a TypeScript error due to a duplicate identifier 'Prepend' in the @types/eslint/helpers.d.ts file. This issue prevents the application from compiling and running the development server.

Here’s the error output:

❯ npm start

> [email protected] start
> node --max_old_space_size=2048 ./node_modules/@angular/cli/bin/ng serve --ssl true --host 0.0.0.0


Warning: This is a simple server for use in testing or debugging Angular applications
locally. It hasn't been reviewed for security issues.

Binding this server to an open connection can result in compromising your application or
computer. Using a different host than the one passed to the "--host" flag might result in
websocket connection issues. You might need to use "--disable-host-check" if that's the
case.

✔ Browser application bundle generation complete.

Build at: 2024-10-14T17:55:33.827Z - Hash: ab910dca08837456 - Time: 13476ms

Error: ../../../../../../node_modules/@types/eslint/helpers.d.ts:1:6 - error TS2300: Duplicate identifier 'Prepend'.

1 type Prepend<Tuple extends any[], Addend> = ((_: Addend, ..._1: Tuple) => any) extends (..._: infer Result) => any
       ~~~~~~~

  node_modules/@types/eslint/helpers.d.ts:1:6
    1 type Prepend<Tuple extends any[], Addend> = ((_: Addend, ..._1: Tuple) => any) extends (..._: infer Result) => any
           ~~~~~~~
    'Prepend' was also declared here.


Error: node_modules/@types/eslint/helpers.d.ts:1:6 - error TS2300: Duplicate identifier 'Prepend'.

1 type Prepend<Tuple extends any[], Addend> = ((_: Addend, ..._1: Tuple) => any) extends (..._: infer Result) => any
       ~~~~~~~

  ../../../../../../node_modules/@types/eslint/helpers.d.ts:1:6
    1 type Prepend<Tuple extends any[], Addend> = ((_: Addend, ..._1: Tuple) => any) extends (..._: infer Result) => any
           ~~~~~~~
    'Prepend' was also declared here.




** Angular Live Development Server is listening on 0.0.0.0:4200, open your browser on https://localhost:4200/ **


✖ Failed to compile.

Steps to reproduce the problem:

  1. In repo navigate to src/portal
  2. Install dependencies using npm install.
  3. Run npm start or ng serve to start the Angular development server. (results in error).

Versions:
Please specify the versions of following systems.

  • harbor version: [2.11.1]
  • docker engine version: [y.y.y]
  • docker-compose version: [z.z.z]

Additional context:

  • Harbor config files: You can get them by packaging harbor.yml and files in the same directory, including subdirectory.
  • Log files: You can get them by package the /var/log/harbor/ .
@wy65701436
Copy link
Contributor

@MinerYang and @AllForNothing Could you please take a look and see if there is anything that needs to be documented regarding the UI development?

bupd added a commit to bupd/harbor that referenced this issue Nov 8, 2024
@bupd bupd linked a pull request Nov 8, 2024 that will close this issue
5 tasks
bupd added a commit to bupd/harbor that referenced this issue Nov 8, 2024
bupd added a commit to bupd/harbor that referenced this issue Nov 8, 2024
@bupd
Copy link
Contributor Author

bupd commented Nov 8, 2024

After testing with different Node versions, no errors were found in version 16.20.2 & 18.20.2. Errors start occurring with versions above this. To fix this, we can set "skipLibCheck": true in tsconfig.json for Node versions greater than 18.20.2, adding support for the latest Node versions.

bupd added a commit to bupd/harbor that referenced this issue Nov 8, 2024
@MinerYang
Copy link
Contributor

Hi @bupd ,

Thanks for your dedicate works, just FYI, our current valid node version is 16.18.0

FROM node:16.18.0 as nodeportal

@bupd
Copy link
Contributor Author

bupd commented Nov 12, 2024

have checked with 16.18.0 and updating the same in .nvmrc file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants