Skip to content

Commit ae864a5

Browse files
Merge pull request #170 from johnmichel/guard-cra-detection
Handle non-successful asset-manifest requests
2 parents a05e979 + d0973aa commit ae864a5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

library/libraries.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1717,7 +1717,11 @@ var d41d8cd98f00b204e9800998ecf8427e_LibraryDetectorTests = {
17171717
// CRA does not have any explicit markers
17181718
// This requests for an asset-manifest.json file that exists for mostly all v2 and v3 CRA apps
17191719
try {
1720-
const response = await fetch('/asset-manifest.json');
1720+
const response = await fetch('asset-manifest.json');
1721+
1722+
if (!response.ok) {
1723+
return false;
1724+
}
17211725
const manifest = await response.json();
17221726

17231727
const hasFilesEntrypoints = manifest.files || manifest.entrypoints;

0 commit comments

Comments
 (0)