try to remove protojs pins#34393
Merged
Merged
Conversation
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
Contributor
Missing ChangesetsThe following package(s) are changed by this PR but do not have a changeset:
See CONTRIBUTING.md for more information about how to add changesets. Changed Packages
|
Since protobufjs 7.5.9, the @protobufjs/inquire utility is no longer called with dynamic module names (replaced by bundler-safe lookups in protobufjs/protobuf.js#2254). However, webpack/rspack still statically analyzes the inquire source and emits a "Critical dependency" warning for its require(moduleName) pattern. This is a false positive — the code path is dead in practice. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Fredrik Adelöw <freben@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Fredrik Adelöw <freben@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Fredrik Adelöw <freben@gmail.com>
Rugvip
approved these changes
May 26, 2026
Rugvip
left a comment
Member
There was a problem hiding this comment.
Alright, seems like an exceptional enough breakage of an existing dependency to make this worthwhile
2 tasks
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.
Summary
Removes the protobufjs/inquire version pins from the seed lockfile and suppresses the resulting bundler warning.
Background
@protobufjs/inquire@1.1.0usedeval("require")(moduleName)to hide a dynamic require from bundlers. When we pinned it, that was the workaround. The maintainer has since published1.1.1and1.1.2which remove the eval, but replace it with a barerequire(moduleName)— still a dynamic require that webpack/rspack flags as "Critical dependency: the request of a dependency is an expression".However, protobufjs 7.5.9 (2026-05-17, PR #2254) backported bundler-safe optional module lookups: all call sites that previously used
util.inquire("fs"),util.inquire("buffer"), etc. were replaced with direct requires using webpack magic comments. Theinquireutility is still in the dependency tree but is never exercised with dynamic module names.What this PR does
Removes the version pins for
protobufjsand@protobufjs/inquirefrompackages/create-app/seed-yarn.lock, letting them resolve naturally (protobufjs 7.6.0, @protobufjs/inquire 1.1.2).Adds an
ignoreWarningsentry in the bundler config (packages/cli-module-build) to suppress the false-positive "Critical dependency" warning from@protobufjs/inquire. The comment in the source explains the reasoning and links to the upstream issue.Why
ignoreWarningsis safe for all end usersThe suppression ships to end users via
@backstage/cli-module-build. This is safe regardless of which protobufjs version they have resolved in their lockfile:@protobufjs/inquireis designed for optional module lookups — it returnsnullwhen a require fails, never crashes. The "Critical dependency" is a bundler static analysis warning, not a runtime error.We considered adding
"protobufjs": ">=7.5.9"as a dependency floor in a published package like@backstage/backend-defaultsto force end users onto the fixed version. We decided against it — theignoreWarningsis sufficient, and promoting a transitive dependency to a direct one just to set a floor could cause resolution conflicts for adopters with other constraints.See also: protobufjs/protobuf.js#2057
Test plan
create-apptest passes (yarn install + tsc + build)🤖 Generated with Claude Code