Skip to content

Commit

Permalink
fix: csb ci sandboxes (#8633)
Browse files Browse the repository at this point in the history
  • Loading branch information
CompuIves authored Oct 10, 2024
1 parent 0a188d2 commit e20b9c8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/sandpack-core/src/npm/merge-dependency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ import * as semver from 'semver';

const VERSIONED_MODULE_RE = /^.+\/\d+\.\d+\.\d+\/.+$/;

function safeSemverGt(v1: string, v2: string): boolean {
try {
return semver.gt(v1, v2);
} catch {
return true;
}
}

export interface ILambdaResponse {
contents: {
[path: string]: { content: string };
Expand Down Expand Up @@ -219,7 +227,7 @@ export function mergeDependencies(responses: ILambdaResponse[]) {
} else if (response.dependencyDependencies[depDepName]) {
const exDepDep = response.dependencyDependencies[depDepName];
// Determine which version is newer, needed for some checks later.
const [newerVersionDepDep, olderVersionDepDep] = semver.gt(
const [newerVersionDepDep, olderVersionDepDep] = safeSemverGt(
newDepDep.resolved,
exDepDep.resolved
)
Expand Down

0 comments on commit e20b9c8

Please sign in to comment.