Skip to content
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

bug: Deprecation warning regarding "ion-router-outlet required" is incorrectly displayed. #23719

Closed
4 of 6 tasks
mp035 opened this issue Aug 4, 2021 · 2 comments · Fixed by #23724
Closed
4 of 6 tasks
Labels
package: vue @ionic/vue package type: bug a confirmed bug report

Comments

@mp035
Copy link

mp035 commented Aug 4, 2021

Prequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

When a developer includes ion-router-outlet inside of ion-tabs the following message is displayed:

[@ionic/vue Deprecation] Starting in Ionic Vue v6.0, developers must add an 'ion-router-outlet' instance inside of 'ion-tabs'.

      Before:

      <ion-tabs>
        <ion-tab-bar slot="bottom">
          ...
        </ion-tab-bar>
      </ion-tabs>

      After:

      <ion-tabs>
        <ion-router-outlet></ion-router-outlet>
        <ion-tab-bar slot="bottom">
          ...
        </ion-tab-bar>
      </ion-tabs>

      Be sure to import 'IonRouterOutlet' from '@ionic/vue' and provide that import to your Vue component. See https://ionicframework.com/docs/vue/navigation#working-with-tabs for more information.

However, when the ion-router-outlet is removed, the warning goes away.

Expected Behavior

The warning should be displayed when ion-router-outlet is not included, and suppressed when ion-router-outlet is included. (i.e. the message suppression state is inverted)

Steps to Reproduce

Run the default, empty ionic 5 tabs application:

ionic start bugtest tabs --type=vue
cd bugtest
ionic serve

And then open the browser console to view the error. It is present even though the template has an ion-router-outlet in the tabs. Removing ion-router-outlet suppresses the message.

Code Reproduction URL

No response

Ionic Info

Ionic:

   Ionic CLI       : 6.16.3 (/home/mark/.nvm/versions/node/v14.17.3/lib/node_modules/@ionic/cli)
   Ionic Framework : @ionic/vue 5.6.12

Capacitor:

   Capacitor CLI      : 3.1.2
   @capacitor/android : not installed
   @capacitor/core    : 3.1.2
   @capacitor/ios     : not installed

Utility:

   cordova-res : not installed globally
   native-run  : 1.4.0

System:

   NodeJS : v14.17.3 (/home/mark/.nvm/versions/node/v14.17.3/bin/node)
   npm    : 6.14.13
   OS     : Linux 5.10

Additional Information

The error is in the source code of
ionic-framework/packages/vue/src/components/IonTabs.ts on line 37:
This line:
if (userProvidedRouterOutlet && !$data.didWarn) {
should be
if (!userProvidedRouterOutlet && !$data.didWarn) {

@liamdebeasi
Copy link
Contributor

Thanks for the issue. This has been resolved via #23724, and a fix will be available in an upcoming release of Ionic Framework.

liamdebeasi added a commit that referenced this issue Aug 4, 2021
@ionitron-bot
Copy link

ionitron-bot bot commented Sep 3, 2021

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: vue @ionic/vue package type: bug a confirmed bug report
Projects
None yet
2 participants