bug: Stencil component importing @ionic/core is breaking @ionic/angular application that has tabs.
See original GitHub issueBug Report
Ionic version:
[x] 4.11.2
Current behavior: Breaking change (ion-tabs) - @ionic/core is fetching tabs list using the ‘ion-tab’ selector which does not exist in ionic/angular
Expected behavior: On application load, the ionic/core tabs.entry.js file code is executed. The list of tabs is retrieved using the ‘ion-tab’ selector which is not part of ionic 4.
Steps to reproduce:
- Clone repo
- npm install
- ionic serve
Open console to check the tabs exception being thrown by the tabs.entry.js file.
Stencil @stencil/core: 1.7.3 Stencil component code
Ionic info:
Ionic:
Ionic CLI : 5.4.4 (C:\Users\Sanaa\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.11.1
@angular-devkit/build-angular : 0.801.3
@angular-devkit/schematics : 8.1.3
@angular/cli : 8.1.3
@ionic/angular-toolkit : 2.0.0
Utility:
cordova-res : not installed
native-run : not installed
System:
NodeJS : v10.16.3 (C:\Program Files\nodejs\node.exe)
npm : 6.9.0
OS : Windows 10
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
bug: Stencil component importing @ionic/core is breaking ...
Expected behavior: On application load, the ionic/core tabs.entry.js file code is executed. The list of tabs is retrieved using the 'ion-tab' ...
Read more >Ionic router/tabs not loading stencil
Can't get component to load in tab using Stencil and Ionic (router, tabs). The code below is based on the Stencil Conference App....
Read more >@ionic/core | Yarn - Package Manager
Ionic is an open source app development toolkit for building modern, fast, top-quality cross-platform native and Progressive Web Apps from a single codebase ......
Read more >You searched for Typescript - Ionic Blog
That means no more app store delays, quicker bug fixes and content changes, and ensuring ... import { Component, h } from '@stencil/core';...
Read more >signature=14611b395b980b0944234a35b2c772db,ionic ...
all: overlay components no longer display outline when focused ... ios: large title transition works properly in tabbed applications ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We’re seeing this issue as well. Creating a component that is meant to be used inside an ionic app - so I was hoping to only include ionic components as dev dependencies. but it looks like it’s being included in the build - which causes conflicts in the angular app.
I think I’ve been able to find workarounds to this issue for both library authors and consumers.
For library consumers You can exclude components from being bootstrapped at runtime by the stencil component loader by passing some additional params to the
defineCustomElements()
function as follows.I’ve got a working version of the reference repo from @sanaadostmuhammad https://github.com/adrianfalleiro/stencil-ionic-angular
For library authors It looks like there is a little documented config property named
excludeUnusedDependencies
. Enabling this excludes unused components chunks from being emitted and excludes them from being added to the lazy loader.This is my stencil.config.js.
I’m not a library author, so can’t 100% vouch for this, but you can see my example project. https://github.com/adrianfalleiro/stencil-exclude-unused-dependencies