Closed stefanseifert closed 2 months ago
If you run npm list vue-router
, I believe you'll see that you have two versions of vue-router
installed.
Your project uses 4.3.2, but brdgm-commons
is still pulling in 4.2.5. They both need to use the same Vue Router, otherwise the symbols used by provide
/inject
won't match.
yes, indeed - that solves the problem!
i was under the assumption that the version in packages.json overwrites the version inherited from brdgm-commons (i'm coming from java backend development where this is the case for transitive maven dependencies).
sorry for the noise.
Reproduction
https://github.com/brdgm/joan-of-arc-orleans-solo-helper
Steps to reproduce the bug
Expected behavior
The screen of first round should be displayed without errors
Actual behavior
In the browser console, several warnings and an error is displayed:
Additional information
the problem is, that
useRoute
returns nothing in this case, relevant code snippet for the example above: https://github.com/brdgm/joan-of-arc-orleans-solo-helper/blob/9c9ae389e7de2b5057e3870e49a437cbd35e7a9c/src/views/RoundTurn.vue#L70-L78i suspect the problem is that the route is already created in some way to fill the global $route variable (which cannot be accessed in setup function), and then the call to useRoute in setup fails. but: it worked without problems for the last ~2 years with vue-router versions < 4.3.0.
it seems this mixture of Options API component and setup methods is a rare use case, but it's "officially supported" following this documentation: https://vuejs.org/api/composition-api-setup.html#composition-api-setup - bullet #2. this is our use case and worked well for a lot of components.