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
I have a monorepo, one of its workspaces is an Angular workspace. and I use pnpm to install the dependencies
each workspace has its own node_modules folder.
when I start building this app (the Angular workspace), it fails to find zone.js
it should find it inside node_modules of the Angular app
this debug info may be useful
as you can see it looks in:
dibo/node_modules/zone.js (the monorepo's top-level root)
dibo/apps/mobarmegeen/mobarmegeen-ui/zone.js
but never looks in the correct path which is dibo/apps/mobarmegeen/mobarmegeen-ui/node_modules/zone.js
[DEBUG] Resolving import "zone.js/node" in directory "/home/dibo/dev/@its-dibo/dibo" of type "import-statement"
Checking for package alias matches
Failed to find any package alias matches
Read 25 entries for directory "/"
Read 1 entry for directory "/home"
Read 25 entries for directory "/home/dibo"
Read 4 entries for directory "/home/dibo/dev"
Read 3 entries for directory "/home/dibo/dev/@its-dibo"
The file "/home/dibo/dev/@its-dibo/dibo/package.json" exists
Read 40 entries for directory "/home/dibo/dev/@its-dibo/dibo"
Read 40 entries for directory "/home/dibo/dev/@its-dibo/dibo"
Searching for "zone.js/node" in "node_modules" directories starting from "/home/dibo/dev/@its-dibo/dibo"
Matching "zone.js/node" against "paths" in
"/home/dibo/dev/@its-dibo/dibo/apps/mobarmegeen/mobarmegeen-ui/tsconfig.app.json"
Using "/home/dibo/dev/@its-dibo/dibo/apps/mobarmegeen/mobarmegeen-ui" as "baseURL"
Attempting to load "/home/dibo/dev/@its-dibo/dibo/apps/mobarmegeen/mobarmegeen-ui/zone.js/node" as a file
Failed to read directory "/home/dibo/dev/@its-dibo/dibo/apps/mobarmegeen/mobarmegeen-ui/zone.js": open
/home/dibo/dev/@its-dibo/dibo/apps/mobarmegeen/mobarmegeen-ui/zone.js: no such file or directory
Attempting to load "/home/dibo/dev/@its-dibo/dibo/apps/mobarmegeen/mobarmegeen-ui/zone.js/node" as a directory
Read 40 entries for directory "/home/dibo/dev/@its-dibo/dibo"
Read 2 entries for directory "/home/dibo/dev/@its-dibo/dibo/apps"
Read 2 entries for directory "/home/dibo/dev/@its-dibo/dibo/apps/mobarmegeen"
The file "/home/dibo/dev/@its-dibo/dibo/apps/mobarmegeen/mobarmegeen-ui/package.json" exists
Read 16 entries for directory "/home/dibo/dev/@its-dibo/dibo/apps/mobarmegeen/mobarmegeen-ui"
Failed to read directory "/home/dibo/dev/@its-dibo/dibo/apps/mobarmegeen/mobarmegeen-ui/zone.js": open
/home/dibo/dev/@its-dibo/dibo/apps/mobarmegeen/mobarmegeen-ui/zone.js: no such file or directory
Failed to read directory "/home/dibo/dev/@its-dibo/dibo/apps/mobarmegeen/mobarmegeen-ui/zone.js"
Failed to read directory "/home/dibo/dev/@its-dibo/dibo/apps/mobarmegeen/mobarmegeen-ui/zone.js/node"
Parsed package name "zone.js" and package subpath "./node"
Checking for a package in the directory "/home/dibo/dev/@its-dibo/dibo/node_modules/zone.js/node"
Read 40 entries for directory "/home/dibo/dev/@its-dibo/dibo"
Read 76 entries for directory "/home/dibo/dev/@its-dibo/dibo/node_modules"
Failed to read directory "/home/dibo/dev/@its-dibo/dibo/node_modules/zone.js": open
/home/dibo/dev/@its-dibo/dibo/node_modules/zone.js: no such file or directory
Failed to read directory "/home/dibo/dev/@its-dibo/dibo/node_modules/zone.js"
Attempting to load "/home/dibo/dev/@its-dibo/dibo/node_modules/zone.js/node" as a file
Failed to read directory "/home/dibo/dev/@its-dibo/dibo/node_modules/zone.js": open
/home/dibo/dev/@its-dibo/dibo/node_modules/zone.js: no such file or directory
Attempting to load "/home/dibo/dev/@its-dibo/dibo/node_modules/zone.js/node" as a directory
Failed to read directory "/home/dibo/dev/@its-dibo/dibo/node_modules/zone.js"
Failed to read directory "/home/dibo/dev/@its-dibo/dibo/node_modules/zone.js/node"
✘ [ERROR] Could not resolve "zone.js/node"
angular:polyfills-server:angular:polyfills-server:1:7:
1 │ import 'zone.js/node';
╵ ~~~~~~~~~~~~~~
You can mark the path "zone.js/node" as external to exclude it from the bundle, which will remove
this error and leave the unresolved path in the bundle.
Expected Behavior
zone.js should be resolved from the location of project.json, i.e. from workspace's node_modules rather than the top-level's root dir
Current Behavior
I have a monorepo, one of its workspaces is an Angular workspace. and I use pnpm to install the dependencies
each workspace has its own node_modules folder.
when I start building this app (the Angular workspace), it fails to find zone.js
it should find it inside node_modules of the Angular app
this debug info may be useful
as you can see it looks in:
but never looks in the correct path which is dibo/apps/mobarmegeen/mobarmegeen-ui/node_modules/zone.js
apps/mobarmegeen/mobarmegeen-ui/project.json
nx.json
debug info
Expected Behavior
zone.js should be resolved from the location of project.json, i.e. from workspace's node_modules rather than the top-level's root dir
GitHub Repo
No response
Steps to Reproduce
.
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
The text was updated successfully, but these errors were encountered: