question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error in callback for watcher "value": "TypeError: Cannot read property 'desktop' of undefined" found in <QMenu>

See original GitHub issue

I have this problem when import a new QSelect component,

app.js:67460 [Vue warn]: Error in callback for watcher "value": "TypeError: Cannot read property 'desktop' of undefined" found in ---> <QMenu> <QSelect> <SearchForm> at resources/assets/js/forms/SearchForm.vue <Table> at resources/assets/js/components/Table.vue <Listar> at resources/assets/js/components/ListAdmin.vue <Admin> at resources/assets/js/pages/Admin.vue <QPageContainer> <QLayout> <Default> at resources/assets/js/layout/Default.vue <Main> at resources/assets/js/layout/Main.vue <Root>

I use quasar without quasar CLI in standalone way, my app file look that way

Captura de tela de 2019-08-20 08-37-28

And when debug in the transpiled file app.js

Captura de tela de 2019-08-20 09-09-16

Thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
shandroliscommented, Oct 22, 2019

I’m getting the same error as above, except it only occurs when I compile my own component-library (that builds on top of quasar), and then import that into a different project.

My project is also a Vue app that plugs in Quasar.

However, I do correctly (to my knowledge) do Vue.use (quasar, {<options>}) in my main.ts, and all my packages are up-to-date with the latest versions of quasar. image

image

The issue seems to originate from utils/escape-key.js that tries to make use of the Platform plugin.

After editing the (minified) file directly in my browser (console>sources tab in chrome) with some console.logs, I get the following.

image image

If I change the if-statement as seen in the screenshot in my node-modules directly in both my component library and my web-app into the following, I can use the dropdowns (components that use q-menu) just fine! if (Platform.is === undefined || Platform.is.desktop === true) {

Obviously this would likely bug out the mobile view, so that’s not much of a permanent solution.

::edit:: On second thought, it makes much more sense to turn if (Platform.is === undefined || Platform.is.desktop === true) {

into

if (Platform.is !== undefined && Platform.is.desktop === true) {

0reactions
nikoz84commented, Sep 3, 2019

If someone want the solution, i update de quasar extras, and in the app.js pass the Quasar object with the options. Thanks and sorry for my terrible english @rstoenescu @smolinari smolinari

import Vue from "vue";

import Quasar from "quasar";
import "quasar/dist/quasar.ie.polyfills.umd.min.js";
import lang from "quasar/lang/pt-br.js";
import materialIcons from "quasar/dist/icon-set/material-icons.umd.min.js";
import "@quasar/extras/roboto-font/roboto-font.css";
import "@quasar/extras/material-icons/material-icons.css";

Vue.use(Quasar, {
  lang,
  iconSet: materialIcons
});

Captura de tela de 2019-09-03 19-26-57 Captura de tela de 2019-09-03 19-27-52

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error in callback for watcher in Vue reading properties of null
For some reasons, item will be set to null sometimes, and if u want to read any property (such as value) from null...
Read more >
Error in callback for watcher “view”: TypeError: Cannot read ...
Error in callback for watcher “view”: TypeError: Cannot read property '0' of undefined. I have an external json file (which has the name...
Read more >
error : Cannot read property 'querySelectorAll' of null-Vue.js
Coding example for the question error : Cannot read property 'querySelectorAll' of null-Vue.js.
Read more >
Error in callback for watcher "view": TypeError - Vue Forum
I have an external json file (which has the name contactinfo) which I would like to pull the data from to prefill my...
Read more >
release notes for Qt 6.2 - Qt Project Git Repository Browser
release of Qt shall use UTC-based suffixes in place of the present GMT- ... 73a04edce1 QProcess::startDetached: set the error condition on failure to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found