Skip to content

Commit

Permalink
fix: resolve manifest promise when manifest is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
zkochan committed Jun 1, 2022
1 parent 97e058e commit 6a2f37b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/package-requester/src/packageRequester.ts
Expand Up @@ -439,7 +439,7 @@ function fetchToStore (

if ((pkgFilesIndex?.files) != null) {
const manifest = opts.fetchRawManifest
? safeDeferredPromise<DependencyManifest>()
? safeDeferredPromise<DependencyManifest | undefined>()
: undefined
if (
(
Expand Down Expand Up @@ -473,7 +473,7 @@ Actual package in the store by the given integrity: ${pkgFilesIndex.name}@${pkgF
})
if (manifest != null) {
manifest()
.then((manifest) => bundledManifest.resolve(normalizeBundledManifest(manifest)))
.then((manifest) => bundledManifest.resolve(manifest == null ? manifest : normalizeBundledManifest(manifest)))
.catch(bundledManifest.reject)
}
finishing.resolve(undefined)
Expand All @@ -496,11 +496,11 @@ Actual package in the store by the given integrity: ${pkgFilesIndex.name}@${pkgF
const priority = (++ctx.requestsQueue['counter'] % ctx.requestsQueue['concurrency'] === 0 ? -1 : 1) * 1000 // eslint-disable-line

const fetchManifest = opts.fetchRawManifest
? safeDeferredPromise<DependencyManifest>()
? safeDeferredPromise<DependencyManifest | undefined>()
: undefined
if (fetchManifest != null) {
fetchManifest()
.then((manifest) => bundledManifest.resolve(normalizeBundledManifest(manifest)))
.then((manifest) => bundledManifest.resolve(manifest == null ? manifest : normalizeBundledManifest(manifest)))
.catch(bundledManifest.reject)
}
const fetchedPackage = await ctx.requestsQueue.add(async () => ctx.fetch(
Expand Down

0 comments on commit 6a2f37b

Please sign in to comment.