You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> nx run angular-common:build
Building Angular Package
------------------------------------------------------------------------------
Building entry point '@dd/angular-common'
------------------------------------------------------------------------------
✖ Compiling with Angular sources in Ivy full compilation mode.
NX Cannot read properties of undefined (reading 'has')
Pass --verbose to see the stacktrace.
NX Ran target build for project angular-common (2s)
✖ 1/1 failed
✔ 0/1 succeeded [0 read from cache]
Package Manager Version
No response
Operating System
macOS
Linux
Windows
Other (Please specify)
Additional Information
More information:
The verbose stacktrace reveals that the error originated from the following line in ng-packagr, inside the findFile function. The specific part is the files.has on line 41.
It is obvious that that findFile(searchDirecories) expects searchDirectories to be an array of objects, but for some reason searchDirectories is not an array of objects, but a string (more on that later)
loadPostcssConfiguration itself also expects the searchDirectories parameter to be an array of objects, to be passed directly into findFile
Here's the problem: @nx/angular passes a string to the loadPostcssConfiguration function, but instead of passing an array of objects, it passes in a string.
Angular 18 is not supported by Nx yet, so issues are expected. You must wait for support to be added, which is currently in progress. Please note that support won't land until the Angular 18 stable version is released.
Current Behavior
@nx/angular - 19.0.0-beta.2
ng-packagr - 18.0.0-next.3
Running a build errors with the following message:
"Cannot read properties of undefined (reading 'has')"
Expected Behavior
It should build
GitHub Repo
No response
Steps to Reproduce
I'll try to set one up later. But the additional info below should be quite helpful, I think.
Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
More information:
The verbose stacktrace reveals that the error originated from the following line in ng-packagr, inside the
findFile
function. The specific part is thefiles.has
on line 41.It is obvious that that
findFile(searchDirecories)
expects searchDirectories to be an array of objects, but for some reason searchDirectories is not an array of objects, but a string (more on that later)findFile
is being called by ng-packagr, fromloadPostcssConfiguration
loadPostcssConfiguration
itself also expects thesearchDirectories
parameter to be an array of objects, to be passed directly intofindFile
Here's the problem:
@nx/angular
passes a string to theloadPostcssConfiguration
function, but instead of passing an array of objects, it passes in a string.nx/packages/angular/src/executors/utilities/ng-packagr/stylesheet-processor.ts
Lines 98 to 101 in c49c07d
Possible fix
Replace this part
nx/packages/angular/src/executors/utilities/ng-packagr/stylesheet-processor.ts
Lines 98 to 101 in c49c07d
with
I verified this by patching the file in node_modules. Works as expected
The text was updated successfully, but these errors were encountered: