From 55c12f664219d46dfe54180ee4ccd2aadb4abf5e Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Mon, 16 Sep 2024 07:12:18 +1200 Subject: [PATCH] fix(utils): export map cache is tainted by unreliable parse results --- src/exportMap/builder.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/exportMap/builder.js b/src/exportMap/builder.js index 5348dba37..f7b9006ef 100644 --- a/src/exportMap/builder.js +++ b/src/exportMap/builder.js @@ -92,7 +92,11 @@ export default class ExportMapBuilder { exportMap.mtime = stats.mtime; - exportCache.set(cacheKey, exportMap); + // If the visitor keys were not populated, then we shouldn't save anything to the cache, + // since the parse results may not be reliable. + if (exportMap.visitorKeys) { + exportCache.set(cacheKey, exportMap); + } return exportMap; }