per in-line comment, if an error occurs during buildStart initialization, then the cache may not exist yet during buildDone
since we now use context.error instead of throw during initialization (from the options -> buildStart change), buildEnd will run during initialization - and the cache var is initialized in buildStart as well, so if an error occurs before then, the cache won't exist - we should gracefully handle this in all cases, since it's possible that even creating the cache could throw an error
this error was hiding the underlying error, which was problematic for DX as well as bug reports (see my issue follow-up)
add an integration test for tsconfig to make sure this code works
while this is similar to the previous tsconfig integration tests (that were moved to unit tests), this covers all cases of buildStart errors, and is not specific to the different tsconfig errors (unlike the unit tests)
this test will fail without the source code changes in this commit
Misc Notes
Would be good for a patch release! Especially as this error currently hides actual errors 😕
Summary
If an error occurs during the
buildStart
hook, make sure that thebuildEnd
hook doesn't hide the error with its own errorbuildDone
func had an uninitializedcache
var, as it's initialized inbuildStart
after this thrown errorDetails
per in-line comment, if an error occurs during
buildStart
initialization, then thecache
may not exist yet duringbuildDone
context.error
instead ofthrow
during initialization (from theoptions
->buildStart
change),buildEnd
will run during initialization - and thecache
var is initialized inbuildStart
as well, so if an error occurs before then, thecache
won't exist - we should gracefully handle this in all cases, since it's possible that even creating thecache
could throw an errorthis error was hiding the underlying error, which was problematic for DX as well as bug reports (see my issue follow-up)
add an integration test for
tsconfig
to make sure this code workstsconfig
integration tests (that were moved to unit tests), this covers all cases ofbuildStart
errors, and is not specific to the differenttsconfig
errors (unlike the unit tests)Misc Notes
Would be good for a patch release! Especially as this error currently hides actual errors 😕