Skip to content

Commit 095815b

Browse files
committed
update failBuild message and remove dead code
1 parent 08952e1 commit 095815b

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

src/helpers/serverModuleHelpers.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ function guessUsedEngine(serverModuleContents) {
116116
* to make it Netlify compatible and which they can apply request handling customizations to it (or just leave default in if they generally
117117
* have default one that just missed our known defaults comparison potentially due to custom formatting etc).
118118
* @param {Object} obj
119-
* @param {string} obj.angularVersion Angular version
119+
* @param {string} obj.angularCoreVersion `@angular/core` version
120+
* @param {string | undefined} obj.angularSsrVersion `@angular/ssr` version
120121
* @param {string} obj.siteRoot Root directory of an app
121122
* @param {(msg: string) => never} obj.failPlugin Function to fail the plugin
122123
* @param {'nx' | 'default'} obj.workspaceType The workspace type being parsed
@@ -160,17 +161,13 @@ export async function fixServerTs({
160161
return
161162
}
162163

163-
// check if user has installed runtime package and if the version is 2.2.0 or newer
164+
// check if user has installed runtime package and if the version is 4.0.0 or newer
164165
// userspace `server.ts` file does import utils from runtime, so it has to be resolvable
165166
// from site root and auto-installed plugin in `.netlify/plugins` wouldn't suffice for that.
166167
const angularRuntimeVersionInstalledByUser = await getAngularRuntimeVersion(siteRoot)
167168
if (!angularRuntimeVersionInstalledByUser) {
168169
failBuild(
169-
`Angular@${angularCoreVersion} SSR on Netlify requires '@netlify/angular-runtime' version 2.2.0 or later to be installed. Please install it and try again.`,
170-
)
171-
} else if (!satisfies(angularRuntimeVersionInstalledByUser, '>=2.2.0', { includePrerelease: true })) {
172-
failBuild(
173-
`Angular@${angularCoreVersion} SSR on Netlify requires '@netlify/angular-runtime' version 2.2.0 or later to be installed. Found version "${angularRuntimeVersionInstalledByUser}". Please update it to version 2.2.0 or later and try again.`,
170+
`@angular/ssr@${angularSsrVersion} on Netlify requires '@netlify/angular-runtime@^4.0.0' or later to be installed. Please install it and try again.`,
174171
)
175172
}
176173

0 commit comments

Comments
 (0)