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: IonModal not working on Typescript #23846

Closed
4 of 6 tasks
farisfaisalthena opened this issue Aug 30, 2021 · 6 comments
Closed
4 of 6 tasks

bug: IonModal not working on Typescript #23846

farisfaisalthena opened this issue Aug 30, 2021 · 6 comments
Labels
package: core @ionic/core package type: bug a confirmed bug report
Milestone

Comments

@farisfaisalthena
Copy link

Prequisites

Ionic Framework Version

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

Current Behavior

When importing the code below Visual Studio will not compile and will give me an error Failed to compile.

import { IonModal } from '@ionic/angular/directives/overlays/ion-modal';

@ViewChild(IonModal, { static: true }) modal: IonModal

Expected Behavior

In order to use any functionality from Ion Modal using typescript, compiling the project should not fail

Steps to Reproduce

Copy paste the code below

import { IonModal } from '@ionic/angular/directives/overlays/ion-modal';

@ViewChild(IonModal, { static: true }) modal: IonModal

Code Reproduction URL

No response

Ionic Info

No response

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Aug 30, 2021
@liamdebeasi
Copy link
Contributor

Thanks for the issue. Your import here looks incorrect. It should be:

import { IonModal } from '@ionic/angular';

Can you try that and let me know if it resolves the issue?

If it still does not fix the issue, please reproduce this in an Ionic starter app and provide a link to the repo.

@liamdebeasi liamdebeasi added the needs: reply the issue needs a response from the user label Aug 30, 2021
@ionitron-bot ionitron-bot bot removed the triage label Aug 30, 2021
@farisfaisalthena
Copy link
Author

Module '"@ionic/angular"' has no exported member 'IonModal'. this is the error on the import { IonModal } from '@ionic/angular';

@ionitron-bot ionitron-bot bot added triage and removed needs: reply the issue needs a response from the user labels Aug 30, 2021
@liamdebeasi liamdebeasi added package: core @ionic/core package type: bug a confirmed bug report labels Aug 30, 2021
@ionitron-bot ionitron-bot bot removed the triage label Aug 30, 2021
@liamdebeasi liamdebeasi added this to the 6.0.0-beta.5 milestone Aug 30, 2021
@liamdebeasi
Copy link
Contributor

Thanks! Can you try this dev build and let me know if it resolves the issue?

npm install @ionic/[email protected]

@farisfaisalthena
Copy link
Author

Yup working now

@liamdebeasi
Copy link
Contributor

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

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 29, 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 29, 2021
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

No branches or pull requests

2 participants