Skip to content

Commit

Permalink
refactor(@angular/ssr): mark @angular/platform-server as optional
Browse files Browse the repository at this point in the history
Whlist, this package is not really optional, NPM will install the wrong verson of peer dependencies when the Angular CLI is in prerelease mode.

```ts
STDERR:
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: [email protected]
npm error Found: @angular/[email protected]
npm error node_modules/@angular/animations
npm error   @angular/animations@"^19.1.0-next.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peer @angular/animations@"19.0.1" from @angular/[email protected]
npm error node_modules/@angular/platform-server
npm error   peer @angular/platform-server@"^19.1.0-next.0 || ^19.0.0" from @angular/[email protected]
npm error   node_modules/@angular/ssr
npm error     @angular/ssr@"19.1.0-next.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
```
  • Loading branch information
alan-agius4 committed Dec 2, 2024
1 parent dc456a5 commit 367ef20
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/angular/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
"@angular/platform-server": "^19.0.0 || ^19.1.0-next.0",
"@angular/router": "^19.0.0 || ^19.1.0-next.0"
},
"peerDependenciesMeta": {
"@angular/platform-server": {
"optional": true
}
},
"devDependencies": {
"@angular/common": "^19.1.0-next.0",
"@angular/compiler": "^19.1.0-next.0",
Expand Down

0 comments on commit 367ef20

Please sign in to comment.