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

    Modern CLI fail with class properties

    CLI
    2
    5
    204
    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.
    • J
      jraez last edited by

      I was given a try to modern build, but quasar CLI failed to compile on my classes where properties are declared.

      Module parse failed: Unexpected token (7:16)
      File was processed with these loaders:
       * ./node_modules/eslint-loader/dist/cjs.js
      You may need an additional loader to handle the result of these loaders.
      | 
      | class Profile extends Model {
      >   static prefix = 'accounts'
      |   static apiPath = 'profile'
      | 
      
      

      I understood that properties are not Stage 4 features, but all the help I found say to use babel-eslint not just eslint. I checked my .eslintrc.js (I think it’s the quasar’s default) it’s there but it’s not working.

        parserOptions: {
          parser: 'babel-eslint',
          sourceType: 'module'
        },
      

      Any hints?

      1 Reply Last reply Reply Quote 0
      • T
        tof06 last edited by

        AFAIK, in modern build, babel isn’t used at all, so, I guess it won’t work.

        Unless you absolutly need these properties to be static, you can add a constructor inside your models, and set prefix and apiPath in it. But the properties will be instance properties…

        1 Reply Last reply Reply Quote 0
        • J
          jraez last edited by

          Yes, I need them to be static. Ok, so I don’t use modern then. Is there a plan to support babel “soon”?

          1 Reply Last reply Reply Quote 0
          • T
            tof06 last edited by

            A “modern + babel” support is planned : https://quasar.dev/quasar-cli/modern-build#Future-plans

            1 Reply Last reply Reply Quote 0
            • J
              jraez last edited by

              Hurra! Thanks a lot.

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