bug: Popover backdrop not included in production builds #24129
Labels
package: core
@ionic/core package
type: bug
a confirmed bug report
v6
issues specific to Framework v6
Prerequisites
Ionic Framework Version
Current Behavior
In our Ionic React application, we are using the
IonPopover
component with the backdrop enabled.When developing locally using
npm run start
, the popover opens and the backdrop is shown. Clicking outside of the popover closes it as expected.However, when we deploy to our dev environment, the backdrop is not being shown, and the popover cannot be closed by clicking outside of it.
After some investigation, it appears that the
IonBackdrop
component is being marked as dead code during tree shaking, and not being included in the bundles created bynpm run build
.Explicitly referencing the
IonBackdrop
somewhere in our code fixes the problem (i.e.console.log(IonBackdrop)
).Expected Behavior
After building and deploying the application, the backdrop should show and the user should be able to close the Popover by clicking outside of it.
Steps to Reproduce
IonButton
and anIonPopover
, with the button triggering the popover.npm run build
Code Reproduction URL
https://github.com/jvartanian/backdrop-tree-shaking
Ionic Info
Ionic:
Ionic CLI : 6.18.0 (~/.nvm/versions/node/v16.6.2/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/react 6.0.0-rc.1
Capacitor:
Capacitor CLI : 3.2.5
@capacitor/android : not installed
@capacitor/core : 3.2.5
@capacitor/ios : not installed
Utility:
cordova-res : not installed globally
native-run : 1.5.0
System:
NodeJS : v16.6.2 (/Users/justinvartanian/.nvm/versions/node/v16.6.2/bin/node)
npm : 7.20.3
OS : macOS Big Sur
Additional Information
No response
The text was updated successfully, but these errors were encountered: