-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Update package.json #11030
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Update package.json #11030
Conversation
Fix(deps): resolve ink peer dependency conflict The ink lib (v6.3.1) requires react-devtools-core version ^6.1.2, but version 4.28.5 was being installed, causing a TypeError: devtools.initialize is not a function when running the start script in development mode. react-devtools-core, resolving the unmet peer dependency and allowing the development server to start correctly.
Summary of ChangesHello @anu-sin-theta, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a critical "TypeError" that prevented the development server from starting correctly. The issue stemmed from a peer dependency conflict where the "ink" UI rendering library required a newer version of "react-devtools-core" than what was being installed. By updating the "react-devtools-core" package to the compatible version, the development environment can now initialize properly, allowing developers to run the "start" script without encountering the "devtools.initialize" error. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly identifies and fixes a peer dependency conflict that was causing crashes in the development environment. The change to update react-devtools-core
is the right solution. However, for better long-term maintainability and consistency with existing patterns in this repository, I've suggested using the overrides
field in package.json
instead of adding a direct development dependency. This makes the intent of forcing a transitive dependency version clearer.
Fix(deps):
resolve ink peer dependency conflict
The ink lib (v6.3.1) requires react-devtools-core version ^6.1.2, but version 4.28.5 was being installed, causing a
TypeError: devtools.initialize is not a function
when running the start script in development mode.
TLDR
When running the development server with
pnpm run start
after a fresh install usingpnpm
, the script crashes with theerror
TypeError: devtools.initialize is not a function
.Dive Deeper
This change addresses a runtime
TypeError
that occurs when starting the CLI in development mode viapnpm run start
. The root cause is a classic peer dependency conflict within theink
UI rendering library and its dependencies.The Conflict: The version of
ink
in use (6.3.1
) specifies a peer dependency requirement forreact-devtools-core
of^6.1.2
. However, due to the dependency resolution across the monorepo, a much older version (4.28.5
) was being Installed.The Trigger: This conflict only manifests in development mode (
NODE_ENV=development
) becauseink
attempts toinitialize its devtools, which in turn calls
devtools.initialize()
. This function does not exist on the older4.x
versionof the
react-devtools-core
package, leading to the crash. Production builds are unaffected as they do not initialize the devtools.Reviewer Test Plan
To validate this fix, the reviewer can follow these steps to reproduce the bug and confirm the solution.
main
branch):Ensure you are on a clean
main
branch without this change.Delete existing
node_modules
andpnpm-lock.yaml
for a clean slate:rm -rf node_modules pnpm-lock.yaml
Install dependencies:
pnpm install
Attempt to run the development server:
pnpm run start
Observe the failure: The command should crash with the error
TypeError: devtools.initialize is not a function
.Testing Matrix
Linked issues / bugs