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

@nx/js:verdaccio does not respect "listen" in config.yml. Always uses "port" from nx options (with default). This prevents using https. #23007

Closed
1 of 4 tasks
mwiedmann opened this issue Apr 25, 2024 · 0 comments · Fixed by #26502

Comments

@mwiedmann
Copy link
Contributor

Current Behavior

If you add a "listen" option to the config.yml for the purposes of running Verdaccio on https, the setting is ignored. The reason is because the "port" option from the nx settings for Verdaccio are required (and have a default) and always are used instead. This results in Verdaccio running with --listen PORT.

The related code is:

function createVerdaccioOptions(
  options: VerdaccioExecutorSchema,
  workspaceRoot: string
) {
  const verdaccioArgs: string[] = [];
  if (options.port) {
    verdaccioArgs.push('--listen', options.port.toString());
  }

options.port will always have a value (because of the default in schema.json, so the "listen" value in the config.yml is always ignored it seems.

Expected Behavior

I expect the "listen" setting to be used.

GitHub Repo

No response

Steps to Reproduce

  1. Remove the "port" setting from the nx settings options for Verdaccio
  2. Create a ".verdaccio/config.yml" and add a "listen" setting like listen: "https://localhost:4444"
  3. Reference the config in the nx Verdaccio settings options with `"config": ".verdaccio/config.yml"
  4. Start Verdaccio with nx and note that it still starts on http with the default 4873 port

Nx Report

NX   Report complete - copy this into the issue template



Node   : 20.11.0

OS     : darwin-arm64

yarn   : 4.1.0



nx                 : 18.1.2

@nx/js             : 18.1.2

@nx/jest           : 18.1.2

@nx/linter         : 18.1.2

@nx/eslint         : 18.1.2

@nx/workspace      : 18.1.2

@nx/cypress        : 18.1.2

@nx/devkit         : 18.1.2

@nx/eslint-plugin  : 18.1.2

@nx/react          : 18.1.2

@nx/rollup         : 18.1.2

@nrwl/tao          : 18.1.2

@nx/vite           : 18.1.2

@nx/web            : 18.1.2

typescript         : 5.4.5

Failure Logs

No response

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

FrozenPandaz pushed a commit that referenced this issue Jun 12, 2024
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
- remove default port for verdaccio so it can take port from config file

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #23007
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.

3 participants