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

fix: routing is not working & ionicons not importing correctly #188

Open
NyllRE opened this issue Dec 22, 2022 · 11 comments
Open

fix: routing is not working & ionicons not importing correctly #188

NyllRE opened this issue Dec 22, 2022 · 11 comments
Labels
bug Something isn't working

Comments

@NyllRE
Copy link

NyllRE commented Dec 22, 2022

🐛 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:
image

what happens when I change tabs:
image

as you can see the tabs just get displayed together

if I change tabs again this comes in the console:
image

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

@NyllRE NyllRE added the bug Something isn't working label Dec 22, 2022
@Lexpeartha
Copy link
Collaborator

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/nuxt#14366). 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 and IonContent in your pages, as official ionic docs mention

Let me know if you need further assistance or If I can close the issue 😁

@Lexpeartha
Copy link
Collaborator

also you don't need IonPage in your UiTabs.vue component

@NyllRE
Copy link
Author

NyllRE commented Dec 23, 2022

thanks a lot @Lexpeartha for your help, but unfortunately after I tried all of what you did the same errors persist

  • converted everything into html instead of pug
  • made sure I follow the documentation structure with placing the components
  • reinstalled everything just to make sure
  • switched to yarn instead of pnpm and for some reason the ionicons worked but the routing is still broken

I will be using ionic with plain vue until these errors get fixed because they seriously broke the developer experience. if there's anything I could do to help I'd be happy to because I'm really looking forward to making full stack web and mobile apps with backend and all only using nuxt

@Lexpeartha
Copy link
Collaborator

Hmm, have you tried out my PR?

If It still doesn't work, I would appreciate a reproduction

@NyllRE
Copy link
Author

NyllRE commented Dec 23, 2022

I did try your pr and I even added to it the extra fixes you suggested, is it working with you? because if it does then I will try to restart the project without using pnpm because I feel like most of the issues are from it

@Lexpeartha
Copy link
Collaborator

Let me clarify, you tried cloning [my fork] and it still doesn't work?

For me it worked fine, pnpm just threw few warnings and that's about it. If you could provide more context, errors or reproductions I might have something to go off of

@NyllRE
Copy link
Author

NyllRE commented Dec 24, 2022

yep, I did clone your fork & modified the project based on your recommendations. so it seems to be an issue on my side, I don't know what it could be, when I have free time I will send all useful context I could get

@Lexpeartha
Copy link
Collaborator

Yes, but my fork needs no modifications I've already added them. Did you try it by itself, without making modifications?

@NyllRE
Copy link
Author

NyllRE commented Dec 24, 2022

here's a video of the issues that happens with me with explainations:

@nuxtjs/ionic issues Video

notes:

  • when I re-installed with all the different package managers I did remove the node_packages file
  • I tried modifying the installations with removing and adding different packages to make sure nothing is conficting
  • I changed the tags from thisCase to this-case and also ThisCase and I discovered that using this-case produces a different error:
    • image

the only issue I could think of is that my Fedora has some weird internal issue that could make this error because I guess you use windows/mac and it works with you. I will test it tomorrow with my windows boot and if the issue doesn't return then the issue could be with fedora or linux specifically even though nuxt and @ionic/vue alone work well. other than that I'd be sticking with @ionic/vue

@NyllRE
Copy link
Author

NyllRE commented Dec 26, 2022

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

@NyllRE
Copy link
Author

NyllRE commented Jan 19, 2023

I copied the playground file in this repo and modified it to my needs and it did work. the error from this issue persists

@danielroe danielroe removed their assignment Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants