-
Notifications
You must be signed in to change notification settings - Fork 13.5k
bug: toastController not showing after "Ionic Build", in react #30340
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
Comments
Thank you for submitting the issue! The |
So I am unable to use Quick question, what if I create a "manager" like function and initialize the |
@syafiqmuda The It doesn't hurt to try to make a manager but I would recommend keeping it simple first and creating it on the page that it's needed. Does this information resolve your issue? |
TQ for the clarification, it seem using
The Reason Why I Use this Approach Issue resolve. |
Prerequisites
Ionic Framework Version
v7.x
Current Behavior
I wanted to create a really basic
toast
.src/pages/index.tsx:
src/utils/index.tsx:
Expected Behavior
On "Ionic Serve", it successfully show the toast,
BUT on "Ionic Build" it doesnt show any toast, error or console.log() after toastController.create().
Steps to Reproduce
showToast("Message here");
Ionic Info
[WARN] Error loading @capacitor/ios package.json: Error: Cannot find module '@capacitor/ios/package.json'
[WARN] Error loading @capacitor/android package.json: Error: Cannot find module '@capacitor/android/package.json'
Ionic:
Ionic CLI : 7.2.0 (C:\Users\syafi\AppData\Roaming\nvm\v22.13.0\node_modules@ionic\cli)
Ionic Framework : @ionic/react 8.5.0
Capacitor:
Capacitor CLI : 7.1.0
@capacitor/android : not installed
@capacitor/core : 7.1.0
@capacitor/ios : not installed
Utility:
cordova-res : not installed globally
native-run : 2.0.1
System:
NodeJS : v22.13.0 (C:\Program Files\nodejs\node.exe)
npm : 10.9.2
OS : Windows 10
Additional Information
No response
The text was updated successfully, but these errors were encountered: