Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 17, 2025

Summary

Fixes #13851

Occurred changes and/or fixed issues

The LocaleSelector component accessed this.dev in computed properties without properly mapping it from the Vuex store, causing Vue to emit a warning when the locale selector was opened on the login page.

Technical notes summary

Added ...mapGetters('prefs', ['dev']) to the component's computed properties. The dev getter already exists in the prefs store (lines 249-255 of shell/store/prefs.js) but wasn't being mapped to the component.

Before:

computed: {
  ...mapGetters('i18n', ['selectedLocaleLabel', 'availableLocales']),
  
  showLocale() {
    return (this.availableLocales && Object.keys(this.availableLocales).length > 1) || this.dev;
  },

After:

computed: {
  ...mapGetters('i18n', ['selectedLocaleLabel', 'availableLocales']),
  ...mapGetters('prefs', ['dev']),
  
  showLocale() {
    return (this.availableLocales && Object.keys(this.availableLocales).length > 1) || this.dev;
  },

Areas or cases that should be tested

  • Open browser console and navigate to login page
  • Click the locale selector - verify no Vue warnings appear
  • Verify locale selector still functions correctly (can switch languages)
  • Test with both dev mode enabled and disabled in user preferences

Areas which could experience regressions

  • Locale selector visibility logic (depends on this.dev)
  • "None" locale option visibility (depends on this.dev and process.env.dev)

Screenshot/Video

N/A - console warning fix only, no visual changes

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes
  • The PR has been reviewed in terms of Accessibility
  • The PR has considered, and if applicable tested with, the three Global Roles Admin, Standard User and User Base

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • download.cypress.io
    • Triggering command: /usr/local/bin/node /usr/local/bin/node index.js --exec install (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Warning is printed to console when locale selector is opened</issue_title>
<issue_description><!--------- For bugs and general issues --------->
Setup

  • Rancher version: v2.11.0
  • Rancher UI Extensions: NA
  • Browser type & version: Firefox/Chrome - Latest

Describe the bug

Opening the Locale Selector on the login page prints a warning to the console.

To Reproduce

  1. Navigate to login page
  2. Open the locale selector

Result

Warning is printed to the console

[Vue warn]: Property "dev" was accessed during render but is not defined on instance. 
  at <VPopperContent ref="popperContent" popper-id="popper_9ahq75r4_j0j6d5" theme="dropdown"  ... > 
  at <Popper ref="popper" theme="dropdown" referenceNode=null  ... > 
  at <VDropdown popperClass="localeSelector" shown=true placement="top"  ... > 
  at <LocalSelector mode="login" > 
  at <Login onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< 
Proxy { <target>: {…}, <handler>: {…} }
 > > 
  at <RouterView key="/auth/login" > 
  at <Unauthenticated onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< 
Proxy { <target>: {…}, <handler>: {…} }
 > > 
  at <RouterView> 
  at <App>

Expected Result

No warnings printed to the console.

Screenshots

NA

Additional context

It looks like this warning has existed for a while (#6597). Removing this.dev changes the behavior of the component. </issue_description>

<agent_instructions>When you open the PR, the Fixes line at the start of the comment should reference this issue, 13851</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix warning printed to console when locale selector is opened Fix Vue warning for undefined 'dev' property in LocaleSelector Dec 17, 2025
Copilot AI requested a review from nwmac December 17, 2025 23:31
@nwmac nwmac requested a review from richard-cox December 18, 2025 12:29
@nwmac nwmac added this to the v2.14.0 milestone Dec 18, 2025
@nwmac nwmac marked this pull request as ready for review December 18, 2025 12:29
Copy link
Member

@richard-cox richard-cox left a comment

Choose a reason for hiding this comment

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

I don't think this is the right dev. it was added 13 months ago and the reference here is older (2022)

The pref references the plugin developer option (avatar --> user preference) and falls back on the deprecated / at some point removed 'dev' preference (which was that one pref to rule all weird dev things... which we split into individual ones like plugin developer).

I'm guessing originally pre vue2 there was a global this.dev which pointed to that now obsolete dev pref.

With all of the above in mind isn't the right solution to..??

  1. replace showLocale this.dev with process.env.dev
  2. remove showNone this.dev

Update: looks like originally it was mapped to that pref dev: mapPref(DEV), - https://github.com/rancher/dashboard/pull/6597/changes#diff-381bc382231a48aa8f33d207eb148a9cbfe246e0cb15b32719787a20ff6d6b2cL107. given it's obsolete though we can fix two birds with one stone by the tweak above

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.

Warning is printed to console when locale selector is opened

3 participants