chore: check finalWatchFileSystem.watcher nullability #172
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR, I have added a check for the nullability of
finalWatchFileSystem.watcher
Background
This library is used by the development server that starts up during Gatsby development.
Gatsby features a function named DEV_SSR, which makes it easier to detect SSR errors during development. However, when this feature is enabled in our environment and an actual SSR error occurs, the development server itself shuts down due to the following error in this library:
This prevents us from verifying the content of the SSR error, defeating the purpose of the DEV_SSR feature. While I have not fully investigated why
finalWatchFileSystem.watcher
becomes null, I believe that the modification proposed in this PR will not have any adverse effects. I would appreciate it if you could consider merging this change.