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

esbuild should be a regular dependency, not a peerDependency, in @nx/angular #26770

Closed
1 of 4 tasks
daiscog opened this issue Jun 30, 2024 · 1 comment · Fixed by #27046
Closed
1 of 4 tasks

esbuild should be a regular dependency, not a peerDependency, in @nx/angular #26770

daiscog opened this issue Jun 30, 2024 · 1 comment · Fixed by #27046
Assignees
Labels
outdated scope: angular Issues related to Angular support in Nx type: bug

Comments

@daiscog
Copy link
Contributor

daiscog commented Jun 30, 2024

Current Behavior

Given I have a monorepo containing an Angular app that I build with @nx/angular. I also have other arbitrary projects in the monorepo (not Angular apps) for which I want to use the latest version of esbuild to bundle.

Then when attempting to install the latest version of esbuild as a devDependency in my monorepo, I get peerDependency conflict warnings.

devDependencies:
+ esbuild 0.21.5

 WARN  Issues with peer dependencies found
.
└─┬ @nx/angular 19.3.1
  ├── ✕ unmet peer esbuild@^0.19.2: found 0.21.5
  └─┬ @nrwl/angular 19.3.1
    └─┬ @nx/angular 19.3.1
      ├── ✕ unmet peer esbuild@^0.19.2: found 0.21.5
      └─┬ @nrwl/angular 19.3.1
        └─┬ @nx/angular 19.3.1
          └── ✕ unmet peer esbuild@^0.19.2: found 0.21.5

Expected Behavior

I can use whatever version of esbuild I choose when using it directly and not be forced into using the same version that is used under the hood by @nx/angular.

I believe it is semantically incorrect for @nx/angular to declare esbuild as a peer dependency - it shouldn't need to share one instance with the entire monorepo. E.g., @angular-devkit/build-angular declares esbuild as a regular dependency, not a peer.

Steps to Reproduce

  1. Create a new nx workspace with the Angular preset
  2. Try to install the latest version of esbuild (e.g., pnpm add -D esbuild

Nx Report

NX   Report complete - copy this into the issue template

Node   : 20.12.2
OS     : darwin-x64
pnpm   : 9.4.0

nx                 : 19.3.1
@nx/js             : 19.3.1
@nx/jest           : 19.3.1
@nx/linter         : 19.3.1
@nx/eslint         : 19.3.1
@nx/workspace      : 19.3.1
@nx/angular        : 19.3.1
@nx/devkit         : 19.3.1
@nx/eslint-plugin  : 19.3.1
@nx/playwright     : 19.3.1
@nrwl/tao          : 19.3.1
@nx/web            : 19.3.1
@nx/webpack        : 19.3.1
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/playwright/plugin
@nx/eslint/plugin

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)
@daiscog daiscog changed the title esbuild should be a regular dependency, not a peerDependency, in @nx/agular esbuild should be a regular dependency, not a peerDependency, in @nx/angular Jul 1, 2024
@AgentEnder AgentEnder added the scope: angular Issues related to Angular support in Nx label Jul 8, 2024
meeroslav pushed a commit that referenced this issue Jul 23, 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` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

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

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

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

Fixes #26770
FrozenPandaz pushed a commit that referenced this issue Jul 24, 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` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

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

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

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

Fixes #26770

(cherry picked from commit e7c07ed)
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: angular Issues related to Angular support in Nx type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants