fix: routing is not working & ionicons not importing correctly
See original GitHub issue🐛 The bug
routing is absolutely broken with me, in addition to the issue that nothing works unless i install @ionic/vue
and icons are not importing correctly
icons error:
what happens when I change tabs:
as you can see the tabs just get displayed together
if I change tabs again this comes in the console:
app.vue:
<template lang="pug">
ionApp
UiTabs
</template>
components/Ui/Tabs.vue:
<template lang="pug">
ionPage
ionTabs
ionRouterOutlet
//- https://ionicframework.com/docs/vue/navigation#working-with-tabs
ionTabBar(slot="bottom")
ionTabButton(tab="home" href="/tabs/home")
ionIcon( :icon="ioniconsHome" )
ionLabel Home
ionTabButton(tab="schedule" href="/tabs/schedule")
ionIcon( :icon="ioniconsCalendar" )
ionLabel Schedule
</template>
pages/tabs/Home.vue
<template lang="pug">
h1 this is the home tab
</template>
pages/tabs/Schedule.vue
<template lang="pug">
h1 this is the schedule tab
</template>
🛠️ To reproduce
https://github.com/NyllRE/ionic-nuxt-3
🌈 Expected behaviour
- tabs change correctly
- icons get imported and displayed
ℹ️ Additional context
I tried to remake the project multiple times and these errors keep coming, I install @nuxtjs/ionic
and no component is known, I install @ionic/vue
and the routing is broken, I install @ionic/vue-routing
and the ionicons are not working and the routing is broken. nothing seems to be working fine with my experience
Issue Analytics
- State:
- Created 9 months ago
- Comments:10
Top Results From Across the Web
Problem with routing in Ionic 4
How do i solve this problem? ... The route ( tabs3 ) that you are trying to load is does not exist. make...
Read more >bug: Ionic/vue ionicons error · Issue #18640 - GitHub
I've applied the solution of @Abdlrahmansaber. But it's not working properly (the compile warning and console error disapeared).
Read more >Angular Routing- I have no errors but I cannot do the routing. I ...
I want to route from app to homepage. Here is the code. For App: app-routing.module.ts import { NgModule } from ...
Read more >Navigating the Change with Ionic 4 and Angular Router
After creating pages with the CLI your app-routing.module.ts will automatically be changed, which may or may not help you in some cases.
Read more >Troubleshooting Angular routing - Medium
No matched component is displayed — did you add <router-outlet> to your app.component.html, index.html or the entry component of the lazy-loaded module? If...
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
Hey @NyllRE, I’ve created NyllRE/ionic-nuxt-3#1 which hopefully resolves your issues.
Firstly, it seems that using pug didn’t properly work with ionic (might be related to nuxt/framework#6049). After externalizing vue dependencies it seems to work alright (cc @danielroe would appreciate if you could take a look, since this might hint at some bigger underlying issue)
Secondly I think you forgot to put
IonPage
andIonContent
in your pages, as official ionic docs mentionLet me know if you need further assistance or If I can close the issue 😁
I forgot to mention an important detail, building the app and serving it works fine, the issue is specifically with running it in a dev environment
npm run dev
, so this could be an issue with the bundler not working properly