Skip to content

navigation error by not use the installed plugins #1018

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

Closed
vallemar opened this issue Dec 8, 2022 · 9 comments
Closed

navigation error by not use the installed plugins #1018

vallemar opened this issue Dec 8, 2022 · 9 comments
Labels
bug V3 Issues related to V3

Comments

@vallemar
Copy link
Contributor

vallemar commented Dec 8, 2022

When you navigate to a new page I get this warn because the plugin is not being passed to the newly created app. I have created in my local a array of the plugins that are used and if it is applied in each createApp the error disappears. Warn:

[Vue warn]: injection "Symbol(pinia)" not found.
@rigor789 rigor789 added bug V3 Issues related to V3 labels Dec 8, 2022
@rigor789
Copy link
Member

Should be fixed by 3e5c9f1

@vallemar
Copy link
Contributor Author

@rigor789 can you open this issue, now it doesn't complain about pinia but i have errors in plugins

  [$navigateTo] Failed to navigate:
  Error: Element for MapView already registered.
  If this is intentional set 'overwriteExisting: true' in 'meta' Error: Element for MapView already registered.
  If this is intentional set 'overwriteExisting: true' in 'meta'

@rigor789
Copy link
Member

I'm guessing MapView is registered through app.use()? Well, I guess we can remove/set overwriteExisting to true by default - can't think of a better way to handle this... Because right now it's working as expected, all the plugins you applied to the root instance, are also applied to all navigation apps, so plugins will registerElement every time 🤔

Seems redundant in most cases...

@vallemar
Copy link
Contributor Author

Yes, I know, I think the same thing but there are many components that do this use() syntactic sugar just to register the component. In any case, even the components that do more things should also be updated so that it doesn't fail anyway... If this is not a performance problem, I would set the override to true by default so as not to heat our heads over this...

@rigor789
Copy link
Member

I'm worried about plugins that perhaps do more than just registerElement in .use - those might break when called multiple times as well 🤔

Will need to think a bit more about this, perhaps navigate/modals shouldn't create new apps, or at least make them "sub-apps" of the root app or something like that instead...

@vallemar
Copy link
Contributor Author

vallemar commented Dec 14, 2022

Could you make a function render (h()) that renders the component you navigate to? and so we would not have to create more applications

@camilo02021
Copy link

I'm having the same issue when I use "$navigateTo" when click on button I got " Error: Element for MapView already registered." It is because I'm using the plugging like this: import GoogleMaps from '@nativescript/google-maps/vue' and then const app = createApp(Home)
app.use(GoogleMaps).start(),
It is how the documentation says, I think the "use.()" and the "$navigateTo" they conflict.
Any solution for this?

@vallemar
Copy link
Contributor Author

@camilo02021 you can register MapView as:

import {createApp, registerElement} from 'nativescript-vue';

registerElement("MapView", () => require('@nativescript/google-maps').MapView)

...

@camilo02021
Copy link

camilo02021 commented Apr 10, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug V3 Issues related to V3
Development

No branches or pull requests

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy