diff --git a/src/Fable.Cli/ProjectCracker.fs b/src/Fable.Cli/ProjectCracker.fs index fa6c6cfb74..1907f226e4 100644 --- a/src/Fable.Cli/ProjectCracker.fs +++ b/src/Fable.Cli/ProjectCracker.fs @@ -722,6 +722,7 @@ let getFullProjectOpts (opts: CrackerOptions) = cacheInfo.Version = Literals.VERSION && cacheInfo.Exclude = opts.Exclude + && cacheInfo.FableOptions.Language = opts.FableOptions.Language && ( [ cacheInfo.ProjectPath @@ -789,6 +790,11 @@ let getFullProjectOpts (opts: CrackerOptions) = | None -> let projRefs, mainProj = retryGetCrackedProjects opts + // The cache was considered outdated / invalid so it is better to make + // make sure we have are in a clean state + if IO.Directory.Exists(opts.FableModulesDir) then + IO.Directory.Delete(opts.FableModulesDir, true) + let fableLibDir, pkgRefs = match opts.FableOptions.Language with | Python -> copyFableLibraryAndPackageSourcesPy opts mainProj.PackageReferences diff --git a/src/Fable.Cli/RELEASE_NOTES.md b/src/Fable.Cli/RELEASE_NOTES.md index bc53a9b7ad..1abb7814b2 100644 --- a/src/Fable.Cli/RELEASE_NOTES.md +++ b/src/Fable.Cli/RELEASE_NOTES.md @@ -5,6 +5,8 @@ * Remove fable-py support * Fix #3461: Don't default to javascript if the language requested by the user is unknown (help detect typo) * Improve --help message for the --lang section +* Fix #3464: Invalidate cache when the target language changes +* Always delete the `fable_modules` folder when the cache is invalidated ### 4.1.4