Skip to content

Conversation

@gonzaloriestra
Copy link
Contributor

@gonzaloriestra gonzaloriestra commented Oct 30, 2025

WHY are these changes introduced?

Fixes https://github.com/shop/issues-develop/issues/21321

30-50-gvxvz-gxqdi

WHAT is this pull request doing?

Ignores the plugins @shopify/app or @shopify/plugin-cloudflare because they are already included in the bundle.

That way, the multiple tunnel plugins error won't appear when for some reason the cloudflare plugin is duplicated.

Also, it shows a warning so the users can remove those plugins that may cause conflicts:

30-52-zh53d-07vbb

How to test your changes?

  • npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20251030155921
  • shopify plugins add @shopify/app
  • shopify app dev

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

@github-actions
Copy link
Contributor

github-actions bot commented Oct 30, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
79.22% (+0.15% 🔼)
13495/17034
🟡 Branches
73.07% (+0.19% 🔼)
6581/9007
🟡 Functions
79.27% (+0.08% 🔼)
3472/4380
🟡 Lines
79.59% (+0.15% 🔼)
12750/16020
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / device-authorization.ts
85.71% (-3.35% 🔻)
70.83% (-8.58% 🔻)
100%
85.71% (-3.35% 🔻)

Test suite run success

3322 tests passing in 1360 suites.

Report generated by 🧪jest coverage report action from 29bd2f3

@github-actions

This comment was marked as outdated.

@gonzaloriestra gonzaloriestra marked this pull request as ready for review October 30, 2025 09:55
@gonzaloriestra gonzaloriestra requested review from a team as code owners October 30, 2025 09:55
Copy link
Contributor

@amcaplan amcaplan left a comment

Choose a reason for hiding this comment

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

Checking my understanding: This new logic means that if I have pinned @shopify/app in my package.json, while it might previously have preferred that as the source of command implementations, now it will prefer the version that comes bundled in @shopify/cli?

If so, that seems like a good idea, but I wanted to be sure I understood correctly.

@gonzaloriestra
Copy link
Contributor Author

@amcaplan this is not related to the package.json dependencies. If you include @shopify/app there, it's not added as a plugin.

I'm not sure about how some people are getting into this situation. The only way I found to reproduce it is to install the plugin with shopify plugins add as mentioned in the description.

@gonzaloriestra
Copy link
Contributor Author

@isaacroldan where exactly would you add it? I think we don't have the config in prerun, which is what we need to update.

@isaacroldan
Copy link
Contributor

@gonzaloriestra you do have config in prerun options.config, although I just tested it and the plugins list in that object is read-only so you can't edit it. My question is, at this point the commands have been loaded already, so does removing the plugin actually removes the commands from it?

@gonzaloriestra
Copy link
Contributor Author

Already discussed it with Isaac and this should be safe because:

  • This doesn't affect plugins adding new commands
  • When there are multiple plugins, the bundle ones are used

But we are hiding a weird situation: the users shouldn't have those plugins. I think I prefer to keep raising an error, but handled and explaining how to solve it: #6555

@amcaplan what do you prefer?

Copy link
Contributor

I think we can start by rescuing the situation (because it's not known to be unsafe) but starting to warn users, and eventually we drop support for this entirely and leave it as a handled error.

@gonzaloriestra
Copy link
Contributor Author

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm.

Test the snapshot by installing your package globally:

npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20251030155921

Caution

After installing, validate the version by running just shopify in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@gonzaloriestra gonzaloriestra added this pull request to the merge queue Nov 3, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 3, 2025
Copy link
Contributor

@dmerand dmerand left a comment

Choose a reason for hiding this comment

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

I'm aligned with this approach.

and eventually we drop support for this entirely and leave it as a handled error.

How do we ensure this happens?

@gonzaloriestra gonzaloriestra added this pull request to the merge queue Nov 4, 2025
@gonzaloriestra
Copy link
Contributor Author

How do we ensure this happens?

We don't have a set process for this. I added a reminder to our Slack channel for two months from now.

Merged via the queue into main with commit 12b801f Nov 4, 2025
2 checks passed
@gonzaloriestra gonzaloriestra deleted the fix-multiple-tunnel-plugins-error branch November 4, 2025 08:29
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.

4 participants