<#21524 Nodejs resolve name overrides not being ap...
# github-notifications
c
#21524 Nodejs resolve name overrides not being applied when checking for duplicates Issue created by rokos-angus Describe the bug I have a repo with the following structure
Copy code
apps
  my-app
    frontend
      package.json
      package-lock.json
      BUILD
  my-other-app
    frontend
      package.json
      package-lock.json
      BUILD
And the following in config
Copy code
[source]
root_patterns = [
  "/apps/*",
]

[nodejs.resolves]
"my-lock" = "apps/my-app/frontend/package-lock.json"
"my-other-lock" = "apps/my-other-app/frontend/package-lock.json"
But running e.g.
pants generate-lockfiles --resolve=my-lock
Gives the error
Copy code
10:50:36.15 [ERROR] 1 Exception encountered:

Engine traceback:
  in `generate-lockfiles` goal

ValueError: Projects with root directories 'apps/my-other-app/frontend' and 'apps/my-app/frontend' have the same resolve name frontend. This will cause ambiguities.

To disambiguate, either:

  * Configure [nodejs].resolves to grant the package.json directories different names.
  * Make one package a workspace of the other.
  * Re-configure your source root(s).
However the resolve works with the overridden name when deleting one of the projects. E.g. deleting apps/my-other-app and running
pants generate-lockfiles --resolve=my-lock
gives
Copy code
10:58:52.59 [INFO] Wrote lockfile for the resolve `my-lock` to apps/my-app/frontend/package-lock.json
Pants version 2.22 (but reproducible with 2.23.0rc0 and 2.24.0.dev1) OS Ubuntu 22.04 Additional info Add any other information about the problem here, such as attachments or links to gists, if relevant. pantsbuild/pants