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: action sheet controller referencing ActionSheet before initialized #24549

Closed
4 of 6 tasks
popcorn245 opened this issue Jan 11, 2022 · 7 comments · Fixed by #24681
Closed
4 of 6 tasks

bug: action sheet controller referencing ActionSheet before initialized #24549

popcorn245 opened this issue Jan 11, 2022 · 7 comments · Fixed by #24681
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@popcorn245
Copy link

Prerequisites

Ionic Framework Version

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

Current Behavior

Updated from ionic 5 to 6 and throws an error that has been reported by several users.

Expected Behavior

Should work on as it did before the update

Steps to Reproduce

Start the app and try to use a select on any page.

Code Reproduction URL

https://github.com/popcorn245/ionic6-select-bug

Ionic Info

Ionic:

Ionic CLI : 5.4.16

Utility:

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

System:

NodeJS : v16.13.1
npm : 8.1.2
OS : Windows 10

Additional Information

Related to this issue.

#24448 (comment)

@ionitron-bot ionitron-bot bot added the triage label Jan 11, 2022
@popcorn245
Copy link
Author

image

Also, kills prerender even if not using the component in your build.

@liamdebeasi liamdebeasi self-assigned this Jan 11, 2022
@liamdebeasi
Copy link
Contributor

Thanks for the issue. This behavior broke between RC 2 and RC 3 with RC 2 being the last working version.

@liamdebeasi
Copy link
Contributor

The problem is we are referencing ActionSheet before it is initialized in the compiled JS file:

export const actionSheetController = /*@__PURE__*/createController<ActionSheetOptions, HTMLIonActionSheetElement>('ion-action-sheet', ActionSheet, [{ tagName: 'ion-backdrop', customElement: Backdrop }, { tagName: 'ion-ripple-effect', customElement: RippleEffect }]);

What's interesting is this only impacts ActionSheet. All the other overlays are added to the build file before they are referenced. Only ActionSheet is added after.

@liamdebeasi liamdebeasi changed the title bug: ion-select not working in vanilla app in v6 bug: action sheet controller referencing ActionSheet before initialized Jan 11, 2022
@liamdebeasi liamdebeasi added package: core @ionic/core package type: bug a confirmed bug report labels Jan 11, 2022
@ionitron-bot ionitron-bot bot removed the triage label Jan 11, 2022
@liamdebeasi liamdebeasi removed their assignment Jan 11, 2022
@corysmc
Copy link
Contributor

corysmc commented Jan 30, 2022

So I was seeing this same issue when running stencil in dev serve - however when I pulled the --dev flag off - it's serving properly (but minified - so kind of a pain - but at least it works): stencil build --watch --serve

@stencil/[email protected]
@ionic/[email protected]

Other workaround is to downgrade to @ionic/[email protected]

@GerardvdStelt
Copy link

I have the exact same problem using StencilJS. Using @ionic/[email protected] I can run locally but making a static build (stencil build --prerender) fails due to the before mentioned reason. Upgrading to @ionic/[email protected] makes that I cannot even run locally; the build provides no errors but the browser starts complaining about ActionSheet and doesn't show my page anymore.

Downgrading to @ionic/[email protected] like @corysmc mentions fixes these issues.

@liamdebeasi
Copy link
Contributor

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

@ionitron-bot
Copy link

ionitron-bot bot commented Mar 4, 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 Mar 4, 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
4 participants