Skip to content

Commit

Permalink
fix: do not error when no source maps (#1050)
Browse files Browse the repository at this point in the history
  • Loading branch information
YvesRijckaert authored Feb 14, 2025
1 parent a64bbd9 commit a164b89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/content-source-maps/src/rest/encodeCPAResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ const applyEncoding = (

const { contentSourceMaps } = target.sys;

// Skip if there are no source maps
// For example if an entry has only one unsupported field
if (!contentSourceMaps) {
console.error('Content source maps data is missing');
return;
}

Expand Down Expand Up @@ -130,7 +131,6 @@ export const encodeCPAResponse = (
if (modifiedCPAResponse.sys && 'items' in (modifiedCPAResponse as CPAEntryCollection)) {
const collection = modifiedCPAResponse as CPAEntryCollection;
if (!collection.sys?.contentSourceMapsLookup) {
console.error('Content source maps lookup data is missing');
return collection;
}
const {
Expand Down

0 comments on commit a164b89

Please sign in to comment.