nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
22.97k stars 2.3k forks source link

@nx/angular:browser-esbuild not founds custom plugins #22805

Closed mcfdez closed 3 months ago

mcfdez commented 4 months ago

Current Behavior

When I launch the build command with @nx/angular:browser-esbuild and custom plugins , I get an error that the plugins file is not found, and the plugins file exists:

"executor": "@nx/angular:browser-esbuild",
    "outputs": ["{options.outputPath}"],
    "options": {
        "plugins": [
            "code/tools/builders/frontend/plugin1.js"
        ]
...
> nx run @frontend:build-client:proLocal --watch
NX   Cannot find module 'code/tools/builders/frontend/plugin1.js'

image

Expected Behavior

Plugin path configuration should work.

GitHub Repo

No response

Steps to Reproduce

  1. Add @nx/angular:browser-esbuil as an executor to build the application.
  2. Create a JS file for a plugin is Esbuild.
  3. Reference that file in the project.json configuration.
  4. Execute the build command.

Nx Report

NX   Report complete - copy this into the issue template

Node   : 18.12.1
OS     : linux-x64
npm    : 8.19.2

nx                 : 18.2.4
@nx/js             : 18.2.4
@nx/jest           : 18.2.4
@nx/linter         : 18.2.4
@nx/eslint         : 18.2.4
@nx/workspace      : 18.2.4
@nx/angular        : 18.2.4
@nx/devkit         : 18.2.4
@nx/esbuild        : 18.2.4
@nx/eslint-plugin  : 18.2.4
@nx/node           : 18.2.4
@nx/plugin         : 18.2.4
@nx/react          : 18.2.4
@nrwl/tao          : 18.2.4
@nx/vite           : 18.2.4
@nx/web            : 18.2.4
@nx/webpack        : 18.2.4
typescript         : 5.3.3
---------------------------------------
Community plugins:
@ngrx/effects        : 17.1.1
@ngrx/router-store   : 17.1.1
@ngrx/store          : 17.1.1
@ngrx/store-devtools : 17.1.1
ng-mocks             : 14.12.1

Failure Logs

NX   Cannot find module 'code/tools/builders/frontend/plugin1.js'

Package Manager Version

NPM 8.19.2

Operating System

Additional Information

If I put an absolute path in the project.json plugins array from the system root, NX is able to locate the plugin file.

Coly010 commented 3 months ago

Hey :) Can you try remove code/ from your path and see if that helps?

github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale because more information has not been provided within 7 days. It will be closed in 21 days if no information is provided. If information has been provided, please reply to keep it active. Thanks for being a part of the Nx community! 🙏

github-actions[bot] commented 2 months ago

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.