fix: remove noisy implicit configuration warning from service locator#3837
Merged
Conversation
The warning fired on every default-configuration usage (e.g. a blank CheerioCrawler), not just the rare case where it would actually matter, confusing beginners into thinking something changed about the expected setup. The debug log already records that a default was created; the actual conflict case is still surfaced via ServiceConflictError if it occurs. Closes #3582 # Conflicts: # packages/core/src/service_locator.ts
barjin
force-pushed
the
3582-remove-implicit-configuration-warning
branch
from
July 21, 2026 11:38
d9f5023 to
99c8cc3
Compare
Contributor
|
This behavior is modelled after crawlee-python (pretty much verbatim), so it weirded me out that the JS version logs the warning in a bare-bones project and the Python version doesn't. The reason is that crawlee-python's I'd argue that this is a better fix — the warning might be legit if you manipulate the service locator directly. |
…g the warning Restores the implicit-configuration warnings in ServiceLocator (they still matter if the service locator is manipulated directly) and instead mirrors crawlee-python's BasicCrawler, which resolves the configuration up front in its constructor before the storage client/event manager are ever created. Doing the same in BasicCrawler means the warning no longer fires for the common blank-crawler case, since configuration is already set by the time anything implicitly requests a storage backend or event manager.
janbuchar
approved these changes
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #3582.
ServiceLocator.getEventManager()/getStorageClient()logged a warning about implicitConfigurationcreation any time it happened before an explicitsetConfiguration()call. That's the normal path for basic usage (nobody setsConfigurationexplicitly by default), so the warning showed up as the first log line in even a blank crawler template, which reads as if something in the setup is wrong when it isn't.Removed the warning; the existing debug log already records that a default was created, and the genuine conflict case (implicit creation followed by a later
setConfiguration()call) still throws a clearServiceConflictError.