Skip to content

fix: use cross-spawn to resolve DEP0190 in dataconnect init#10558

Open
fredzqm wants to merge 3 commits into
mainfrom
fix-dep0190-spawn-deprecation-8312636168148387415
Open

fix: use cross-spawn to resolve DEP0190 in dataconnect init#10558
fredzqm wants to merge 3 commits into
mainfrom
fix-dep0190-spawn-deprecation-8312636168148387415

Conversation

@fredzqm
Copy link
Copy Markdown
Contributor

@fredzqm fredzqm commented May 26, 2026

Fixes a Node.js DEP0190 DeprecationWarning that occurs when running firebase init dataconnect while creating an app template.

The warning (Passing args to a child process with shell option true can lead to security vulnerabilities) was triggered because child_process.spawn was used with the shell: true option to ensure commands like npm and npx ran correctly on all platforms.

This fix updates src/init/features/dataconnect/create_app.ts to use cross-spawn instead, which properly escapes arguments and handles cross-platform execution (especially on Windows) without needing the unsafe shell: true option.


PR created automatically by Jules for task 8312636168148387415 started by @fredzqm

Co-authored-by: fredzqm <9068391+fredzqm@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a 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 replaces the native child_process spawn with cross-spawn and removes the shell: true option when executing commands. The reviewer points out that removing shell: true prevents manual shell-quoting of arguments from being stripped, which will cause issues in createNextApp where nested double quotes are used for the import alias. The reviewer suggests updating createNextApp to remove the nested double quotes.

Comment on lines 40 to 43
const childProcess = spawn(command, args, {
// 'inherit' pipes stdin, stdout, and stderr to the parent process
stdio: "inherit",
// Runs the command in a shell, which allows for shell syntax like pipes, etc.
shell: true,
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

With the removal of shell: true, arguments are no longer evaluated by a shell. This means any manual shell-quoting of arguments in the calling functions is no longer stripped and will be passed literally to the spawned process.

Specifically, in createNextApp (around line 23), the import alias argument is defined as '"@/*"'. Because shell: true is removed, the literal double quotes will be passed to create-next-app, resulting in an invalid import alias configuration in the generated Next.js app.

Please update createNextApp to remove the nested double quotes:

    "--import-alias",
    "@/*",

google-labs-jules Bot and others added 2 commits May 26, 2026 23:28
Co-authored-by: fredzqm <9068391+fredzqm@users.noreply.github.com>
Co-authored-by: fredzqm <9068391+fredzqm@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants