No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    'undefined' error due to missing Platform plugin when using Popover

    Help
    3
    4
    1054
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • tmladek
      tmladek last edited by tmladek

      Hello!
      I’m trying to use a QPopover as in the docs (i.e. the <q-popover> is a direct descendant of <q-btn>), but when I click the button, I get this error:
      TypeError: __WEBPACK_IMPORTED_MODULE_0__plugins_platform__.a.is is undefined

      edit: above error in Firefox, Chrome provides the much more descriptive Uncaught TypeError: Cannot read property 'desktop' of undefined.

      I’ve tracked it down to the file escape-key.js, which checks the Platform object; which my debugger confirms is indeed undefined:

      0_1528900204767_scrnsht.png

      The QPopover is correctly included in components in quasar.conf.js, as well as Platform in plugins, and I am not sure what else could be the cause of this error.

      Thanks in advance!

      E 1 Reply Last reply Reply Quote 0
      • E
        etcodev @tmladek last edited by

        @tmladek what about if you try importing like this ?

        import { Platform } from 'quasar'
        

        It’s working for me in a state.js file:

        import { Platform } from 'quasar'
        
        export default {
          platform: Platform
        }
        
        1 Reply Last reply Reply Quote 0
        • rstoenescu
          rstoenescu Admin last edited by

          The scenario described here is impossible… Plugin platform is always installed. Can I take a look on a reproduction repo pls?
          Might be that uglifyjs messes things up. What Quasar version are you using? Does it happen on dev mode?

          1 Reply Last reply Reply Quote 1
          • tmladek
            tmladek last edited by

            Hello again! I’m afraid that this issue might have solved itself.

            I realized I accidentally lied about the <q-popover> being a direct child of <q-btn>, because it was in a different component (of which the QPopover was the root element). Changing this and putting the <q-popover> directly in the parent component solved the issue, so I thought this was the problem; but when I reverted back to it being separate, it actually still works and I can’t reproduce the error.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post