So I have tried probably everything, downgrading versions/combinations of packages, still did not manage to make it work. If anyone succeeded, please share the wisdom.
So far I have filed the bug:
opened 03:50AM - 12 Jan 24 UTC
Project:Mobile
The default starting vue app `meteor create --vue simple-todos-vue` with `meteor… -vite`, as well as custom one, using customised `vuejs:vue` (https://github.com/vbgm/meteor-vue3-less) in Cordova iOS (did not check on Android yet) as well as in Electron `meteor-desktop@3.1.1` have the same error related to `TypeError: effect2 of dep.keys is not a function`.
### Steps to reproduce
1. `meteor create --vue simple-todos-vue`
2. `cd simple-todos-vue`
3. `meteor add-platform ios` - assuming Xcode and prerequisites installed
4. `meteor add cordova:cordova-plugin-meteor-webapp@2.0.0` - because of meteor 2.14 cordova bug
5. `meteor run ios`
6. Observe that in browser the app starts and renders normally, whereas in Cordova and Electron there is a blank screen. When looking to Web Inspector console on either Cordova or Electron - there is the same / very similar error message.
### Actual behaviour
White screen of death
### Expected behavior
Rendering app
### Details
The full error log is below, I am still investigating the exact circumstances, so far I have understood that it is not because of `vue-router`(I've tried all the major versions) but rather ability of rendering dynamic variables inside templates, because static text is rendered without issues. The same I have seen before on Meteor 2.13.3 on my custom vue build and thought maybe it was my specific issue, yet it is the same elsewhere.
### System
* MacOS Ventura 13.5.2
* Meteor 2.13.3 and also 2.14 - the default `meteor create --vue simple-todos-vue` app
### Latest working
The latest working version of `vue` with Cordova iOS was 2.6.14 (not higher), tested both on Cordova iOS and Electron.
### Full log
```
[Log] HMR: connected (hot-module-replacement.js, line 343)
[Warning] [Vue warn]: Unhandled error during execution of setup function (11) (cordova.js, line 1413)
"
"
" at <RouterLink"
"to="
{name: "home"}
">"
"
"
" at <Header>"
"
"
" at <Index>"
"
"
" at <App>"
[Warning] [Vue Router warn]: Unexpected error when starting the router: – TypeError: effect2 of dep.keys is not a function. (In 'effect2 of dep.keys()', 'effect2 of dep.keys' is undefined) — modules.js:36357 (cordova.js, line 1413)
TypeError: effect2 of dep.keys is not a function. (In 'effect2 of dep.keys()', 'effect2 of dep.keys' is undefined) — modules.js:36357
[Log] Uncaught Error: TypeError: effect2 of dep.keys is not a function. (In 'effect2 of dep.keys()', 'effect2 of dep.keys' is undefined):26881:http://localhost:12296/__cordova/packages/modules.js?hash=11599c4652c72ee6b3afc396fa029552a6c4a1e4 (cordova.js, line 1413)
[Error] TypeError: effect2 of dep.keys is not a function. (In 'effect2 of dep.keys()', 'effect2 of dep.keys' is undefined)
logError (modules.js:26881)
handleError (modules.js:26868)
callWithErrorHandling (modules.js:26820)
setupStatefulComponent (modules.js:34206)
setupComponent (modules.js:34167)
mountComponent (modules.js:32496)
processComponent (modules.js:32462)
patch (modules.js:31941)
mountChildren (modules.js:32189)
mountElement (modules.js:32096)
processElement (modules.js:32061)
patch (modules.js:31929)
componentUpdateFn (modules.js:32606)
run (modules.js:36245)
(anonymous function) (modules.js:32730)
setupRenderEffect (modules.js:32740)
mountComponent (modules.js:32508)
processComponent (modules.js:32462)
patch (modules.js:31941)
mountChildren (modules.js:32189)
mountElement (modules.js:32096)
processElement (modules.js:32061)
patch (modules.js:31929)
componentUpdateFn (modules.js:32606)
run (modules.js:36245)
(anonymous function) (modules.js:32730)
setupRenderEffect (modules.js:32740)
mountComponent (modules.js:32508)
processComponent (modules.js:32462)
patch (modules.js:31941)
mountChildren (modules.js:32189)
processFragment (modules.js:32405)
patch (modules.js:31915)
componentUpdateFn (modules.js:32606)
run (modules.js:36245)
(anonymous function) (modules.js:32730)
setupRenderEffect (modules.js:32740)
mountComponent (modules.js:32508)
processComponent (modules.js:32462)
patch (modules.js:31941)
render (modules.js:33251)
mount (modules.js:30590)
(anonymous function) (modules.js:20022)
(anonymous function) (app.js:610)
maybeReady (meteor.js:1033)
releaseReadyHold (meteor.js:1022)
(anonymous function) (cordova.js:827)
(anonymous function) (cordova.js:232)
```
I have a slight hope that this happens because of dynamic path in router, but even when I set hash history, still no luck:
import { createRouter, createWebHashHistory } from 'vue-router'
const router = createRouter({
history: createWebHashHistory('/some-base/'),
routes: [
//...
],
})
opened 06:22PM - 24 Mar 22 UTC
closed 06:33PM - 24 Mar 22 UTC
I want to change the scheme and hostname in my app to a custom URL scheme that h… as dynamic url params. Because the URL params are dynamic (using vue.js router) the app needs to account for rendering specific UI and data based on the param.
For instance, I have a QR reader that redirects the user to a view that renders UI based on the URL param id..
So the QR reader redirects the user to a view such as https://xxxxxxxx.com/12345 where the param id is 12345.
In that case, how should I alter the code from my config.xml file below?
<preference name="scheme" value="app" />
<preference name="hostname" value="localhost" />
Building the app in Vue.js and using https://github.com/m0dch3n/vue-cli-plugin-cordova as a codova plugin.
However in Vue2 the router was in normal history mode without issues…
Hi,
Did you try with --production
when you do meteor run
?
I had the same error and with --production
, I was able to run on Cordova (Android) in development.
opened 05:31PM - 30 Dec 23 UTC
I am trying to have the `meteor create --vue` project working in development env… ironment with Cordova on Android device.
Before moving forward, is it known to work?
Also, what would be the right configuration between `ROOT_URL, MOBILE_ROOT_URL, --mobile-server` and the `server` option in `vite.config.js` file?
Thanks.
I still did not go to build and deployment.
This doesn’t solve the problem, but it could be a clue.
Thanks for the hint, I’ll check it. Might be not a permanent option, but at least something until the bug is fixed.