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: Karma incorrectly reports [main] attribute deprecation #24563

Closed
4 of 6 tasks
davidgeary opened this issue Jan 12, 2022 · 4 comments · Fixed by #24565
Closed
4 of 6 tasks

bug: Karma incorrectly reports [main] attribute deprecation #24563

davidgeary opened this issue Jan 12, 2022 · 4 comments · Fixed by #24565
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@davidgeary
Copy link

Prerequisites

Ionic Framework Version

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

Current Behavior

When running the tests on an Ionic 6 application containing an ion-menu component, the following warning is sometimes issued, even though the related template does not use a main attribute:

WARN: '[DEPRECATED][ion-menu] Using the [main] attribute is deprecated, please use the "contentId" property instead:
BEFORE:
  <ion-menu>...</ion-menu>
  <div main>...</div>

AFTER:
  <ion-menu contentId="main-content"></ion-menu>
  <div id="main-content">...</div>
'

Sometimes, the tests will also issue the error/warning:

ERROR: 'Menu: must have a "content" element to listen for drag events on.'

WARN: 'split pane does not have a specified main node'

Expected Behavior

No warning should be issued.

Steps to Reproduce

Create a new Ionic starter project containing a menu and then just run the tests, e.g.

ionic start foo sidemenu --type=angular --no-git
cd .\foo
ng test

Code Reproduction URL

No response

Ionic Info

Ionic:

Ionic CLI : 6.18.1 (C:\Users\David\AppData\Roaming\nvm\v16.13.0\node_modules@ionic\cli)
Ionic Framework : @ionic/angular 6.0.2
@angular-devkit/build-angular : 13.1.2
@angular-devkit/schematics : 12.0.1
@angular/cli : 13.1.2
@ionic/angular-toolkit : 5.0.3

Capacitor:

Capacitor CLI : 3.3.4
@capacitor/android : 3.3.4
@capacitor/core : 3.3.4
@capacitor/ios : 3.3.4

Utility:

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

System:

NodeJS : v16.13.0 (C:\Program Files\nodejs\node.exe)
npm : 8.1.0
OS : Windows 10

Additional Information

This can be reproduced on the most simple example - the default starter project uses the following template but displays the warning:

<ion-app>
  <ion-split-pane contentId="main-content">
    <ion-menu contentId="main-content" type="overlay">
      <!-- Menu items omitted for brevity... -->
    </ion-menu>
    <ion-router-outlet id="main-content"></ion-router-outlet>
  </ion-split-pane>
</ion-app>

According to #20142, the deprecation warnings were removed as part of Ionic Framework v5. However, this doesn't appear to be the case - see this line in menu.tsx.

@liamdebeasi
Copy link
Contributor

Thanks! The "main attribute is deprecated" message will be removed via #24565.

The other errors appear to be caused by something separate, so I opened #24566 to continue investigation for that.

@liamdebeasi
Copy link
Contributor

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

Please follow #24566 for updates on that issue. Thanks!

@davidgeary
Copy link
Author

@liamdebeasi Thanks for the quick turnaround

@ionitron-bot
Copy link

ionitron-bot bot commented Feb 11, 2022

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 Feb 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants