Skip to content

Unable to use esbuild plugins in native-federation #665

@thefirst24

Description

@thefirst24

With what library do you have an issue?

native-federation

Reproduction of the bug/regression with instructions

  1. Set "@angular-architects/native-federation:build" executor for serve target with target option "project:serve-original:development"
  2. Set "@angular-devkit/build-angular:dev-server" executor for "serve-original" target with build target "project:esbuild:development"
  3. Set "@angular-builders/custom-esbuild:application" or "@nx/angular:application" executor for "esbuild" target
  4. Add plugins to options for esbuild target
  5. Run "nx serve project" command
  6. Get error "Data path "" must NOT have additional properties(plugins)."

Full error:
Error: Schema validation failed with the following errors:
Data path "" must NOT have additional properties(plugins).
at name (node_modules@angular-devkit\architect\src\architect.js:228:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

I logged builderName variable in _validateOptionsFactory in architect.js line and it print out "@angular-devkit/build-angular:application" for some reason

Expected behavior

Successfully build the application with esbuild plugins.

Versions of Native/Module Federation, Angular, Node, Browser, and operating system

"dependencies": {
"@angular/animations": "18.2.0",
"@angular/common": "18.2.0",
"@angular/compiler": "18.2.0",
"@angular/core": "18.2.0",
"@angular/forms": "18.2.0",
"@angular/platform-browser": "18.2.0",
"@angular/platform-browser-dynamic": "18.2.0",
"@angular/router": "18.2.0",
},
"devDependencies": {
"@angular-architects/module-federation": "^18.0.6",
"@angular-architects/native-federation": "^18.2.2",
"@angular-builders/custom-esbuild": "^18.0.0",
"@angular-devkit/build-angular": "^18.2.0",
"@angular-devkit/core": "18.2.0",
"@angular-devkit/schematics": "18.2.0",
"@angular/build": "^18.2.8",
"@angular/cdk": "18.2.0",
"@angular/cli": "~18.2.0",
"@angular/compiler-cli": "18.2.0",
"@nx/angular": "19.6.1",
"@nx/devkit": "19.6.1",
"@nx/jest": "19.6.1",
"@nx/js": "19.6.1",
"@nx/playwright": "19.6.1",
"@nx/plugin": "19.6.1",
"@nx/web": "19.6.1",
"@nx/webpack": "19.6.1",
"@nx/workspace": "19.6.1",
"nx": "19.6.1",
"typescript": "5.5.4",
}

Other information

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions